# Generated from CoreDSL2.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
[docs]
def serializedATN():
return [
4,1,102,797,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,2,14,7,14,2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7,19,2,
20,7,20,2,21,7,21,2,22,7,22,2,23,7,23,2,24,7,24,2,25,7,25,2,26,7,
26,2,27,7,27,2,28,7,28,2,29,7,29,2,30,7,30,2,31,7,31,2,32,7,32,2,
33,7,33,2,34,7,34,2,35,7,35,2,36,7,36,2,37,7,37,2,38,7,38,2,39,7,
39,2,40,7,40,2,41,7,41,2,42,7,42,2,43,7,43,2,44,7,44,2,45,7,45,2,
46,7,46,2,47,7,47,2,48,7,48,1,0,5,0,100,8,0,10,0,12,0,103,9,0,1,
0,4,0,106,8,0,11,0,12,0,107,1,1,1,1,1,1,1,2,1,2,1,2,1,2,1,2,1,2,
5,2,119,8,2,10,2,12,2,122,9,2,3,2,124,8,2,1,2,1,2,5,2,128,8,2,10,
2,12,2,131,9,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,5,2,140,8,2,10,2,12,2,
143,9,2,3,2,145,8,2,1,2,1,2,5,2,149,8,2,10,2,12,2,152,9,2,1,2,3,
2,155,8,2,1,3,1,3,1,3,1,3,1,3,1,3,4,3,163,8,3,11,3,12,3,164,1,3,
1,3,1,3,1,3,1,3,4,3,172,8,3,11,3,12,3,173,1,3,1,3,1,3,1,3,5,3,180,
8,3,10,3,12,3,183,9,3,1,3,1,3,5,3,187,8,3,10,3,12,3,190,9,3,1,3,
1,3,1,3,5,3,195,8,3,10,3,12,3,198,9,3,1,3,1,3,4,3,202,8,3,11,3,12,
3,203,1,3,1,3,3,3,208,8,3,1,4,1,4,5,4,212,8,4,10,4,12,4,215,9,4,
1,4,1,4,1,5,1,5,5,5,221,8,5,10,5,12,5,224,9,5,1,5,1,5,1,5,1,5,1,
5,1,5,5,5,232,8,5,10,5,12,5,235,9,5,1,5,1,5,1,5,1,5,1,5,1,5,1,5,
1,5,1,5,3,5,246,8,5,1,5,3,5,249,8,5,1,5,1,5,1,5,1,5,1,5,1,6,1,6,
1,6,5,6,259,8,6,10,6,12,6,262,9,6,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,
7,3,7,272,8,7,1,8,1,8,1,8,1,8,1,8,3,8,279,8,8,1,8,1,8,5,8,283,8,
8,10,8,12,8,286,9,8,1,8,1,8,1,8,1,8,1,8,1,8,3,8,294,8,8,1,8,1,8,
5,8,298,8,8,10,8,12,8,301,9,8,1,8,1,8,3,8,305,8,8,3,8,307,8,8,1,
9,1,9,1,9,5,9,312,8,9,10,9,12,9,315,9,9,1,10,1,10,3,10,319,8,10,
1,11,1,11,1,11,1,11,1,11,1,11,5,11,327,8,11,10,11,12,11,330,9,11,
3,11,332,8,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,
1,11,1,11,1,11,1,11,5,11,348,8,11,10,11,12,11,351,9,11,1,11,1,11,
3,11,355,8,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,
1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,
1,11,1,11,1,11,5,11,383,8,11,10,11,12,11,386,9,11,1,11,5,11,389,
8,11,10,11,12,11,392,9,11,1,11,1,11,1,11,1,11,3,11,398,8,11,1,11,
1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,3,11,410,8,11,1,12,
4,12,413,8,12,11,12,12,12,414,1,12,4,12,418,8,12,11,12,12,12,419,
1,13,1,13,1,13,1,13,1,13,1,13,3,13,428,8,13,1,14,1,14,5,14,432,8,
14,10,14,12,14,435,9,14,1,14,1,14,1,15,1,15,3,15,441,8,15,1,16,1,
16,3,16,445,8,16,1,16,3,16,448,8,16,1,16,3,16,451,8,16,1,16,1,16,
1,16,1,16,5,16,457,8,16,10,16,12,16,460,9,16,3,16,462,8,16,1,17,
1,17,1,17,5,17,467,8,17,10,17,12,17,470,9,17,1,17,1,17,1,17,1,17,
5,17,476,8,17,10,17,12,17,479,9,17,3,17,481,8,17,1,17,1,17,1,18,
1,18,1,18,3,18,488,8,18,1,19,1,19,1,19,1,19,1,19,1,19,3,19,496,8,
19,1,19,1,19,1,19,1,19,1,19,1,19,3,19,504,8,19,1,19,1,19,5,19,508,
8,19,10,19,12,19,511,9,19,1,19,1,19,1,19,1,19,1,19,1,19,1,19,3,19,
520,8,19,1,19,1,19,1,19,3,19,525,8,19,1,19,1,19,1,19,1,19,3,19,531,
8,19,1,20,1,20,1,21,1,21,1,22,1,22,1,23,1,23,1,23,1,23,1,23,1,23,
1,23,1,23,5,23,547,8,23,10,23,12,23,550,9,23,1,23,1,23,3,23,554,
8,23,1,23,1,23,1,24,1,24,1,24,1,24,1,24,1,24,1,24,1,24,1,24,3,24,
567,8,24,1,24,1,24,1,25,1,25,1,25,5,25,574,8,25,10,25,12,25,577,
9,25,1,26,1,26,1,26,1,26,3,26,583,8,26,1,27,1,27,1,27,1,27,5,27,
589,8,27,10,27,12,27,592,9,27,1,27,1,27,1,28,1,28,3,28,598,8,28,
1,29,1,29,1,29,1,29,1,29,5,29,605,8,29,10,29,12,29,608,9,29,1,29,
5,29,611,8,29,10,29,12,29,614,9,29,1,29,1,29,3,29,618,8,29,1,30,
1,30,1,30,1,30,3,30,624,8,30,1,30,1,30,3,30,628,8,30,1,31,1,31,3,
31,632,8,31,1,31,1,31,1,31,3,31,637,8,31,5,31,639,8,31,10,31,12,
31,642,9,31,1,32,4,32,645,8,32,11,32,12,32,646,1,32,1,32,1,32,1,
33,1,33,1,33,1,33,1,33,1,33,3,33,658,8,33,1,34,1,34,1,34,1,34,1,
34,1,34,1,34,1,34,1,34,5,34,669,8,34,10,34,12,34,672,9,34,3,34,674,
8,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,3,34,686,
8,34,1,34,1,34,1,34,3,34,691,8,34,1,34,1,34,1,34,1,34,1,34,1,34,
1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,
1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,
1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,
1,34,1,34,3,34,740,8,34,1,34,1,34,1,34,1,34,5,34,746,8,34,10,34,
12,34,749,9,34,1,35,1,35,1,35,4,35,754,8,35,11,35,12,35,755,1,35,
1,35,1,35,1,35,3,35,762,8,35,1,36,1,36,1,37,1,37,1,37,1,37,1,37,
3,37,771,8,37,1,38,1,38,1,39,1,39,1,40,1,40,1,41,1,41,1,42,1,42,
1,43,1,43,1,43,1,44,1,44,1,44,1,45,1,45,1,46,1,46,1,47,1,47,1,48,
1,48,1,48,0,1,68,49,0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,
34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,
78,80,82,84,86,88,90,92,94,96,0,18,1,0,41,42,1,0,43,46,1,0,47,48,
1,0,52,53,1,0,54,55,2,0,34,35,56,57,1,0,58,59,2,0,34,34,60,61,1,
0,56,57,1,0,62,63,2,0,36,37,64,65,1,0,66,67,2,0,50,50,73,83,1,0,
98,99,3,0,38,39,41,48,84,84,1,0,85,86,2,0,19,19,87,88,1,0,89,90,
880,0,101,1,0,0,0,2,109,1,0,0,0,4,154,1,0,0,0,6,207,1,0,0,0,8,209,
1,0,0,0,10,218,1,0,0,0,12,255,1,0,0,0,14,271,1,0,0,0,16,306,1,0,
0,0,18,308,1,0,0,0,20,316,1,0,0,0,22,409,1,0,0,0,24,412,1,0,0,0,
26,427,1,0,0,0,28,429,1,0,0,0,30,440,1,0,0,0,32,447,1,0,0,0,34,468,
1,0,0,0,36,484,1,0,0,0,38,530,1,0,0,0,40,532,1,0,0,0,42,534,1,0,
0,0,44,536,1,0,0,0,46,538,1,0,0,0,48,557,1,0,0,0,50,570,1,0,0,0,
52,582,1,0,0,0,54,584,1,0,0,0,56,597,1,0,0,0,58,599,1,0,0,0,60,627,
1,0,0,0,62,631,1,0,0,0,64,644,1,0,0,0,66,657,1,0,0,0,68,690,1,0,
0,0,70,761,1,0,0,0,72,763,1,0,0,0,74,770,1,0,0,0,76,772,1,0,0,0,
78,774,1,0,0,0,80,776,1,0,0,0,82,778,1,0,0,0,84,780,1,0,0,0,86,782,
1,0,0,0,88,785,1,0,0,0,90,788,1,0,0,0,92,790,1,0,0,0,94,792,1,0,
0,0,96,794,1,0,0,0,98,100,3,2,1,0,99,98,1,0,0,0,100,103,1,0,0,0,
101,99,1,0,0,0,101,102,1,0,0,0,102,105,1,0,0,0,103,101,1,0,0,0,104,
106,3,4,2,0,105,104,1,0,0,0,106,107,1,0,0,0,107,105,1,0,0,0,107,
108,1,0,0,0,108,1,1,0,0,0,109,110,5,1,0,0,110,111,5,99,0,0,111,3,
1,0,0,0,112,113,5,2,0,0,113,123,5,96,0,0,114,115,5,3,0,0,115,120,
5,96,0,0,116,117,5,4,0,0,117,119,5,96,0,0,118,116,1,0,0,0,119,122,
1,0,0,0,120,118,1,0,0,0,120,121,1,0,0,0,121,124,1,0,0,0,122,120,
1,0,0,0,123,114,1,0,0,0,123,124,1,0,0,0,124,125,1,0,0,0,125,129,
5,5,0,0,126,128,3,6,3,0,127,126,1,0,0,0,128,131,1,0,0,0,129,127,
1,0,0,0,129,130,1,0,0,0,130,132,1,0,0,0,131,129,1,0,0,0,132,155,
5,6,0,0,133,134,5,7,0,0,134,144,5,96,0,0,135,136,5,8,0,0,136,141,
5,96,0,0,137,138,5,4,0,0,138,140,5,96,0,0,139,137,1,0,0,0,140,143,
1,0,0,0,141,139,1,0,0,0,141,142,1,0,0,0,142,145,1,0,0,0,143,141,
1,0,0,0,144,135,1,0,0,0,144,145,1,0,0,0,145,146,1,0,0,0,146,150,
5,5,0,0,147,149,3,6,3,0,148,147,1,0,0,0,149,152,1,0,0,0,150,148,
1,0,0,0,150,151,1,0,0,0,151,153,1,0,0,0,152,150,1,0,0,0,153,155,
5,6,0,0,154,112,1,0,0,0,154,133,1,0,0,0,155,5,1,0,0,0,156,157,5,
9,0,0,157,162,5,5,0,0,158,163,3,34,17,0,159,160,3,68,34,0,160,161,
5,10,0,0,161,163,1,0,0,0,162,158,1,0,0,0,162,159,1,0,0,0,163,164,
1,0,0,0,164,162,1,0,0,0,164,165,1,0,0,0,165,166,1,0,0,0,166,167,
5,6,0,0,167,208,1,0,0,0,168,169,5,11,0,0,169,171,5,5,0,0,170,172,
3,16,8,0,171,170,1,0,0,0,172,173,1,0,0,0,173,171,1,0,0,0,173,174,
1,0,0,0,174,175,1,0,0,0,175,176,5,6,0,0,176,208,1,0,0,0,177,181,
5,12,0,0,178,180,3,46,23,0,179,178,1,0,0,0,180,183,1,0,0,0,181,179,
1,0,0,0,181,182,1,0,0,0,182,184,1,0,0,0,183,181,1,0,0,0,184,188,
5,5,0,0,185,187,3,10,5,0,186,185,1,0,0,0,187,190,1,0,0,0,188,186,
1,0,0,0,188,189,1,0,0,0,189,191,1,0,0,0,190,188,1,0,0,0,191,208,
5,6,0,0,192,196,5,13,0,0,193,195,3,46,23,0,194,193,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,201,5,5,0,0,200,202,3,8,4,0,201,200,1,0,0,0,202,203,
1,0,0,0,203,201,1,0,0,0,203,204,1,0,0,0,204,205,1,0,0,0,205,206,
5,6,0,0,206,208,1,0,0,0,207,156,1,0,0,0,207,168,1,0,0,0,207,177,
1,0,0,0,207,192,1,0,0,0,208,7,1,0,0,0,209,213,5,96,0,0,210,212,3,
46,23,0,211,210,1,0,0,0,212,215,1,0,0,0,213,211,1,0,0,0,213,214,
1,0,0,0,214,216,1,0,0,0,215,213,1,0,0,0,216,217,3,28,14,0,217,9,
1,0,0,0,218,222,5,96,0,0,219,221,3,46,23,0,220,219,1,0,0,0,221,224,
1,0,0,0,222,220,1,0,0,0,222,223,1,0,0,0,223,225,1,0,0,0,224,222,
1,0,0,0,225,226,5,5,0,0,226,227,5,14,0,0,227,228,5,15,0,0,228,233,
3,14,7,0,229,230,5,16,0,0,230,232,3,14,7,0,231,229,1,0,0,0,232,235,
1,0,0,0,233,231,1,0,0,0,233,234,1,0,0,0,234,236,1,0,0,0,235,233,
1,0,0,0,236,248,5,10,0,0,237,238,5,17,0,0,238,245,5,15,0,0,239,246,
5,99,0,0,240,241,5,5,0,0,241,242,5,99,0,0,242,243,5,4,0,0,243,244,
5,99,0,0,244,246,5,6,0,0,245,239,1,0,0,0,245,240,1,0,0,0,246,247,
1,0,0,0,247,249,5,10,0,0,248,237,1,0,0,0,248,249,1,0,0,0,249,250,
1,0,0,0,250,251,5,18,0,0,251,252,5,15,0,0,252,253,3,22,11,0,253,
254,5,6,0,0,254,11,1,0,0,0,255,260,3,14,7,0,256,257,5,16,0,0,257,
259,3,14,7,0,258,256,1,0,0,0,259,262,1,0,0,0,260,258,1,0,0,0,260,
261,1,0,0,0,261,13,1,0,0,0,262,260,1,0,0,0,263,272,3,76,38,0,264,
265,5,96,0,0,265,266,5,91,0,0,266,267,3,76,38,0,267,268,5,15,0,0,
268,269,3,76,38,0,269,270,5,92,0,0,270,272,1,0,0,0,271,263,1,0,0,
0,271,264,1,0,0,0,272,15,1,0,0,0,273,274,5,19,0,0,274,275,3,36,18,
0,275,276,5,96,0,0,276,278,5,20,0,0,277,279,3,18,9,0,278,277,1,0,
0,0,278,279,1,0,0,0,279,280,1,0,0,0,280,284,5,21,0,0,281,283,3,46,
23,0,282,281,1,0,0,0,283,286,1,0,0,0,284,282,1,0,0,0,284,285,1,0,
0,0,285,287,1,0,0,0,286,284,1,0,0,0,287,288,5,10,0,0,288,307,1,0,
0,0,289,290,3,36,18,0,290,291,5,96,0,0,291,293,5,20,0,0,292,294,
3,18,9,0,293,292,1,0,0,0,293,294,1,0,0,0,294,295,1,0,0,0,295,299,
5,21,0,0,296,298,3,46,23,0,297,296,1,0,0,0,298,301,1,0,0,0,299,297,
1,0,0,0,299,300,1,0,0,0,300,304,1,0,0,0,301,299,1,0,0,0,302,305,
3,28,14,0,303,305,5,10,0,0,304,302,1,0,0,0,304,303,1,0,0,0,305,307,
1,0,0,0,306,273,1,0,0,0,306,289,1,0,0,0,307,17,1,0,0,0,308,313,3,
20,10,0,309,310,5,4,0,0,310,312,3,20,10,0,311,309,1,0,0,0,312,315,
1,0,0,0,313,311,1,0,0,0,313,314,1,0,0,0,314,19,1,0,0,0,315,313,1,
0,0,0,316,318,3,36,18,0,317,319,3,58,29,0,318,317,1,0,0,0,318,319,
1,0,0,0,319,21,1,0,0,0,320,410,3,28,14,0,321,322,5,96,0,0,322,331,
5,20,0,0,323,328,3,68,34,0,324,325,5,4,0,0,325,327,3,68,34,0,326,
324,1,0,0,0,327,330,1,0,0,0,328,326,1,0,0,0,328,329,1,0,0,0,329,
332,1,0,0,0,330,328,1,0,0,0,331,323,1,0,0,0,331,332,1,0,0,0,332,
333,1,0,0,0,333,334,5,21,0,0,334,410,5,10,0,0,335,336,5,22,0,0,336,
337,5,20,0,0,337,338,3,68,34,0,338,339,5,21,0,0,339,349,3,22,11,
0,340,341,5,23,0,0,341,342,5,22,0,0,342,343,5,20,0,0,343,344,3,68,
34,0,344,345,5,21,0,0,345,346,3,22,11,0,346,348,1,0,0,0,347,340,
1,0,0,0,348,351,1,0,0,0,349,347,1,0,0,0,349,350,1,0,0,0,350,354,
1,0,0,0,351,349,1,0,0,0,352,353,5,23,0,0,353,355,3,22,11,0,354,352,
1,0,0,0,354,355,1,0,0,0,355,410,1,0,0,0,356,357,5,24,0,0,357,358,
5,20,0,0,358,359,3,32,16,0,359,360,5,21,0,0,360,361,3,22,11,0,361,
410,1,0,0,0,362,363,5,25,0,0,363,364,5,20,0,0,364,365,3,68,34,0,
365,366,5,21,0,0,366,367,3,22,11,0,367,410,1,0,0,0,368,369,5,26,
0,0,369,370,3,22,11,0,370,371,5,25,0,0,371,372,5,20,0,0,372,373,
3,68,34,0,373,374,5,21,0,0,374,375,5,10,0,0,375,410,1,0,0,0,376,
377,5,27,0,0,377,378,5,20,0,0,378,379,3,68,34,0,379,380,5,21,0,0,
380,384,5,5,0,0,381,383,3,24,12,0,382,381,1,0,0,0,383,386,1,0,0,
0,384,382,1,0,0,0,384,385,1,0,0,0,385,390,1,0,0,0,386,384,1,0,0,
0,387,389,3,26,13,0,388,387,1,0,0,0,389,392,1,0,0,0,390,388,1,0,
0,0,390,391,1,0,0,0,391,393,1,0,0,0,392,390,1,0,0,0,393,394,5,6,
0,0,394,410,1,0,0,0,395,397,5,28,0,0,396,398,3,68,34,0,397,396,1,
0,0,0,397,398,1,0,0,0,398,399,1,0,0,0,399,410,5,10,0,0,400,401,5,
29,0,0,401,410,5,10,0,0,402,403,5,30,0,0,403,410,5,10,0,0,404,405,
5,31,0,0,405,410,3,22,11,0,406,407,3,68,34,0,407,408,5,10,0,0,408,
410,1,0,0,0,409,320,1,0,0,0,409,321,1,0,0,0,409,335,1,0,0,0,409,
356,1,0,0,0,409,362,1,0,0,0,409,368,1,0,0,0,409,376,1,0,0,0,409,
395,1,0,0,0,409,400,1,0,0,0,409,402,1,0,0,0,409,404,1,0,0,0,409,
406,1,0,0,0,410,23,1,0,0,0,411,413,3,26,13,0,412,411,1,0,0,0,413,
414,1,0,0,0,414,412,1,0,0,0,414,415,1,0,0,0,415,417,1,0,0,0,416,
418,3,22,11,0,417,416,1,0,0,0,418,419,1,0,0,0,419,417,1,0,0,0,419,
420,1,0,0,0,420,25,1,0,0,0,421,422,5,32,0,0,422,423,3,68,34,0,423,
424,5,15,0,0,424,428,1,0,0,0,425,426,5,33,0,0,426,428,5,15,0,0,427,
421,1,0,0,0,427,425,1,0,0,0,428,27,1,0,0,0,429,433,5,5,0,0,430,432,
3,30,15,0,431,430,1,0,0,0,432,435,1,0,0,0,433,431,1,0,0,0,433,434,
1,0,0,0,434,436,1,0,0,0,435,433,1,0,0,0,436,437,5,6,0,0,437,29,1,
0,0,0,438,441,3,22,11,0,439,441,3,34,17,0,440,438,1,0,0,0,440,439,
1,0,0,0,441,31,1,0,0,0,442,448,3,34,17,0,443,445,3,68,34,0,444,443,
1,0,0,0,444,445,1,0,0,0,445,446,1,0,0,0,446,448,5,10,0,0,447,442,
1,0,0,0,447,444,1,0,0,0,448,450,1,0,0,0,449,451,3,68,34,0,450,449,
1,0,0,0,450,451,1,0,0,0,451,452,1,0,0,0,452,461,5,10,0,0,453,458,
3,68,34,0,454,455,5,4,0,0,455,457,3,68,34,0,456,454,1,0,0,0,457,
460,1,0,0,0,458,456,1,0,0,0,458,459,1,0,0,0,459,462,1,0,0,0,460,
458,1,0,0,0,461,453,1,0,0,0,461,462,1,0,0,0,462,33,1,0,0,0,463,467,
3,94,47,0,464,467,3,92,46,0,465,467,3,46,23,0,466,463,1,0,0,0,466,
464,1,0,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,480,3,36,18,0,472,
477,3,58,29,0,473,474,5,4,0,0,474,476,3,58,29,0,475,473,1,0,0,0,
476,479,1,0,0,0,477,475,1,0,0,0,477,478,1,0,0,0,478,481,1,0,0,0,
479,477,1,0,0,0,480,472,1,0,0,0,480,481,1,0,0,0,481,482,1,0,0,0,
482,483,5,10,0,0,483,35,1,0,0,0,484,487,3,38,19,0,485,488,5,34,0,
0,486,488,5,35,0,0,487,485,1,0,0,0,487,486,1,0,0,0,487,488,1,0,0,
0,488,37,1,0,0,0,489,495,3,40,20,0,490,496,3,42,21,0,491,492,5,36,
0,0,492,493,3,70,35,0,493,494,5,37,0,0,494,496,1,0,0,0,495,490,1,
0,0,0,495,491,1,0,0,0,496,531,1,0,0,0,497,531,3,42,21,0,498,531,
3,44,22,0,499,531,5,38,0,0,500,531,5,39,0,0,501,503,3,96,48,0,502,
504,5,96,0,0,503,502,1,0,0,0,503,504,1,0,0,0,504,505,1,0,0,0,505,
509,5,5,0,0,506,508,3,54,27,0,507,506,1,0,0,0,508,511,1,0,0,0,509,
507,1,0,0,0,509,510,1,0,0,0,510,512,1,0,0,0,511,509,1,0,0,0,512,
513,5,6,0,0,513,531,1,0,0,0,514,515,3,96,48,0,515,516,5,96,0,0,516,
531,1,0,0,0,517,519,5,40,0,0,518,520,5,96,0,0,519,518,1,0,0,0,519,
520,1,0,0,0,520,521,1,0,0,0,521,522,5,5,0,0,522,524,3,50,25,0,523,
525,5,4,0,0,524,523,1,0,0,0,524,525,1,0,0,0,525,526,1,0,0,0,526,
527,5,6,0,0,527,531,1,0,0,0,528,529,5,40,0,0,529,531,5,96,0,0,530,
489,1,0,0,0,530,497,1,0,0,0,530,498,1,0,0,0,530,499,1,0,0,0,530,
500,1,0,0,0,530,501,1,0,0,0,530,514,1,0,0,0,530,517,1,0,0,0,530,
528,1,0,0,0,531,39,1,0,0,0,532,533,7,0,0,0,533,41,1,0,0,0,534,535,
7,1,0,0,535,43,1,0,0,0,536,537,7,2,0,0,537,45,1,0,0,0,538,539,5,
49,0,0,539,553,5,96,0,0,540,541,5,50,0,0,541,554,3,68,34,0,542,543,
5,20,0,0,543,548,3,68,34,0,544,545,5,4,0,0,545,547,3,68,34,0,546,
544,1,0,0,0,547,550,1,0,0,0,548,546,1,0,0,0,548,549,1,0,0,0,549,
551,1,0,0,0,550,548,1,0,0,0,551,552,5,21,0,0,552,554,1,0,0,0,553,
540,1,0,0,0,553,542,1,0,0,0,553,554,1,0,0,0,554,555,1,0,0,0,555,
556,5,51,0,0,556,47,1,0,0,0,557,558,5,36,0,0,558,566,3,70,35,0,559,
560,5,4,0,0,560,561,3,70,35,0,561,562,5,4,0,0,562,563,3,70,35,0,
563,564,5,4,0,0,564,565,3,70,35,0,565,567,1,0,0,0,566,559,1,0,0,
0,566,567,1,0,0,0,567,568,1,0,0,0,568,569,5,37,0,0,569,49,1,0,0,
0,570,575,3,52,26,0,571,572,5,4,0,0,572,574,3,52,26,0,573,571,1,
0,0,0,574,577,1,0,0,0,575,573,1,0,0,0,575,576,1,0,0,0,576,51,1,0,
0,0,577,575,1,0,0,0,578,583,5,96,0,0,579,580,5,96,0,0,580,581,5,
50,0,0,581,583,3,68,34,0,582,578,1,0,0,0,582,579,1,0,0,0,583,53,
1,0,0,0,584,585,3,56,28,0,585,590,3,58,29,0,586,587,5,4,0,0,587,
589,3,58,29,0,588,586,1,0,0,0,589,592,1,0,0,0,590,588,1,0,0,0,590,
591,1,0,0,0,591,593,1,0,0,0,592,590,1,0,0,0,593,594,5,10,0,0,594,
55,1,0,0,0,595,598,3,36,18,0,596,598,3,92,46,0,597,595,1,0,0,0,597,
596,1,0,0,0,598,57,1,0,0,0,599,606,5,96,0,0,600,601,5,91,0,0,601,
602,3,68,34,0,602,603,5,92,0,0,603,605,1,0,0,0,604,600,1,0,0,0,605,
608,1,0,0,0,606,604,1,0,0,0,606,607,1,0,0,0,607,612,1,0,0,0,608,
606,1,0,0,0,609,611,3,46,23,0,610,609,1,0,0,0,611,614,1,0,0,0,612,
610,1,0,0,0,612,613,1,0,0,0,613,617,1,0,0,0,614,612,1,0,0,0,615,
616,5,50,0,0,616,618,3,60,30,0,617,615,1,0,0,0,617,618,1,0,0,0,618,
59,1,0,0,0,619,628,3,68,34,0,620,621,5,5,0,0,621,623,3,62,31,0,622,
624,5,4,0,0,623,622,1,0,0,0,623,624,1,0,0,0,624,625,1,0,0,0,625,
626,5,6,0,0,626,628,1,0,0,0,627,619,1,0,0,0,627,620,1,0,0,0,628,
61,1,0,0,0,629,632,3,64,32,0,630,632,3,60,30,0,631,629,1,0,0,0,631,
630,1,0,0,0,632,640,1,0,0,0,633,636,5,4,0,0,634,637,3,64,32,0,635,
637,3,60,30,0,636,634,1,0,0,0,636,635,1,0,0,0,637,639,1,0,0,0,638,
633,1,0,0,0,639,642,1,0,0,0,640,638,1,0,0,0,640,641,1,0,0,0,641,
63,1,0,0,0,642,640,1,0,0,0,643,645,3,66,33,0,644,643,1,0,0,0,645,
646,1,0,0,0,646,644,1,0,0,0,646,647,1,0,0,0,647,648,1,0,0,0,648,
649,5,50,0,0,649,650,3,60,30,0,650,65,1,0,0,0,651,652,5,91,0,0,652,
653,3,68,34,0,653,654,5,92,0,0,654,658,1,0,0,0,655,656,5,52,0,0,
656,658,5,96,0,0,657,651,1,0,0,0,657,655,1,0,0,0,658,67,1,0,0,0,
659,660,6,34,-1,0,660,691,3,70,35,0,661,662,7,3,0,0,662,691,5,96,
0,0,663,664,5,96,0,0,664,673,5,20,0,0,665,670,3,68,34,0,666,667,
5,4,0,0,667,669,3,68,34,0,668,666,1,0,0,0,669,672,1,0,0,0,670,668,
1,0,0,0,670,671,1,0,0,0,671,674,1,0,0,0,672,670,1,0,0,0,673,665,
1,0,0,0,673,674,1,0,0,0,674,675,1,0,0,0,675,691,5,21,0,0,676,677,
7,4,0,0,677,691,3,68,34,17,678,679,7,5,0,0,679,691,3,68,34,16,680,
681,7,6,0,0,681,691,3,68,34,15,682,685,5,20,0,0,683,686,3,36,18,
0,684,686,3,40,20,0,685,683,1,0,0,0,685,684,1,0,0,0,686,687,1,0,
0,0,687,688,5,21,0,0,688,689,3,68,34,14,689,691,1,0,0,0,690,659,
1,0,0,0,690,661,1,0,0,0,690,663,1,0,0,0,690,676,1,0,0,0,690,678,
1,0,0,0,690,680,1,0,0,0,690,682,1,0,0,0,691,747,1,0,0,0,692,693,
10,13,0,0,693,694,7,7,0,0,694,746,3,68,34,14,695,696,10,12,0,0,696,
697,7,8,0,0,697,746,3,68,34,13,698,699,10,11,0,0,699,700,7,9,0,0,
700,746,3,68,34,12,701,702,10,10,0,0,702,703,7,10,0,0,703,746,3,
68,34,11,704,705,10,9,0,0,705,706,7,11,0,0,706,746,3,68,34,10,707,
708,10,8,0,0,708,709,5,35,0,0,709,746,3,68,34,9,710,711,10,7,0,0,
711,712,5,68,0,0,712,746,3,68,34,8,713,714,10,6,0,0,714,715,5,69,
0,0,715,746,3,68,34,7,716,717,10,5,0,0,717,718,5,70,0,0,718,746,
3,68,34,6,719,720,10,4,0,0,720,721,5,71,0,0,721,746,3,68,34,5,722,
723,10,3,0,0,723,724,5,16,0,0,724,746,3,68,34,4,725,726,10,2,0,0,
726,727,5,72,0,0,727,728,3,68,34,0,728,729,5,15,0,0,729,730,3,68,
34,2,730,746,1,0,0,0,731,732,10,1,0,0,732,733,7,12,0,0,733,746,3,
68,34,1,734,735,10,20,0,0,735,736,5,91,0,0,736,739,3,68,34,0,737,
738,5,15,0,0,738,740,3,68,34,0,739,737,1,0,0,0,739,740,1,0,0,0,740,
741,1,0,0,0,741,742,5,92,0,0,742,746,1,0,0,0,743,744,10,18,0,0,744,
746,7,4,0,0,745,692,1,0,0,0,745,695,1,0,0,0,745,698,1,0,0,0,745,
701,1,0,0,0,745,704,1,0,0,0,745,707,1,0,0,0,745,710,1,0,0,0,745,
713,1,0,0,0,745,716,1,0,0,0,745,719,1,0,0,0,745,722,1,0,0,0,745,
725,1,0,0,0,745,731,1,0,0,0,745,734,1,0,0,0,745,743,1,0,0,0,746,
749,1,0,0,0,747,745,1,0,0,0,747,748,1,0,0,0,748,69,1,0,0,0,749,747,
1,0,0,0,750,762,5,96,0,0,751,762,3,74,37,0,752,754,3,72,36,0,753,
752,1,0,0,0,754,755,1,0,0,0,755,753,1,0,0,0,755,756,1,0,0,0,756,
762,1,0,0,0,757,758,5,20,0,0,758,759,3,68,34,0,759,760,5,21,0,0,
760,762,1,0,0,0,761,750,1,0,0,0,761,751,1,0,0,0,761,753,1,0,0,0,
761,757,1,0,0,0,762,71,1,0,0,0,763,764,7,13,0,0,764,73,1,0,0,0,765,
771,3,76,38,0,766,771,3,78,39,0,767,771,3,82,41,0,768,771,3,84,42,
0,769,771,3,80,40,0,770,765,1,0,0,0,770,766,1,0,0,0,770,767,1,0,
0,0,770,768,1,0,0,0,770,769,1,0,0,0,771,75,1,0,0,0,772,773,5,95,
0,0,773,77,1,0,0,0,774,775,5,94,0,0,775,79,1,0,0,0,776,777,5,93,
0,0,777,81,1,0,0,0,778,779,5,97,0,0,779,83,1,0,0,0,780,781,5,99,
0,0,781,85,1,0,0,0,782,783,5,91,0,0,783,784,5,91,0,0,784,87,1,0,
0,0,785,786,5,92,0,0,786,787,5,92,0,0,787,89,1,0,0,0,788,789,7,14,
0,0,789,91,1,0,0,0,790,791,7,15,0,0,791,93,1,0,0,0,792,793,7,16,
0,0,793,95,1,0,0,0,794,795,7,17,0,0,795,97,1,0,0,0,88,101,107,120,
123,129,141,144,150,154,162,164,173,181,188,196,203,207,213,222,
233,245,248,260,271,278,284,293,299,304,306,313,318,328,331,349,
354,384,390,397,409,414,419,427,433,440,444,447,450,458,461,466,
468,477,480,487,495,503,509,519,524,530,548,553,566,575,582,590,
597,606,612,617,623,627,631,636,640,646,657,670,673,685,690,739,
745,747,755,761,770
]
[docs]
class CoreDSL2Parser ( Parser ):
[docs]
grammarFileName = "CoreDSL2.g4"
[docs]
atn = ATNDeserializer().deserialize(serializedATN())
[docs]
decisionsToDFA = [ DFA(ds, i) for i, ds in enumerate(atn.decisionToState) ]
[docs]
sharedContextCache = PredictionContextCache()
[docs]
literalNames = [ "<INVALID>", "'import'", "'InstructionSet'", "'extends'",
"','", "'{'", "'}'", "'Core'", "'provides'", "'architectural_state'",
"';'", "'functions'", "'instructions'", "'always'",
"'encoding'", "':'", "'::'", "'assembly'", "'behavior'",
"'extern'", "'('", "')'", "'if'", "'else'", "'for'",
"'while'", "'do'", "'switch'", "'return'", "'break'",
"'continue'", "'spawn'", "'case'", "'default'", "'*'",
"'&'", "'<'", "'>'", "'bool'", "'void'", "'enum'",
"'unsigned'", "'signed'", "'char'", "'short'", "'int'",
"'long'", "'float'", "'double'", "'[['", "'='", "']]'",
"'.'", "'->'", "'++'", "'--'", "'+'", "'-'", "'~'",
"'!'", "'/'", "'%'", "'<<'", "'>>'", "'<='", "'>='",
"'=='", "'!='", "'^'", "'|'", "'&&'", "'||'", "'?'",
"'+='", "'-='", "'*='", "'/='", "'&='", "'|='", "'^='",
"'>>='", "'>>>='", "'<<='", "'%='", "'alias'", "'const'",
"'volatile'", "'static'", "'register'", "'struct'",
"'union'", "'['", "']'" ]
[docs]
symbolicNames = [ "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>",
"<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>",
"<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>",
"<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>",
"<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>",
"<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>",
"<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>",
"<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>",
"<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>",
"<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>",
"<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>",
"<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>",
"<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>",
"<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>",
"<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>",
"<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>",
"<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>",
"<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>",
"<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>",
"<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>",
"<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>",
"<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>",
"<INVALID>", "<INVALID>", "<INVALID>", "LEFT_BR",
"RIGHT_BR", "BOOLEAN", "FLOAT", "INTEGER", "IDENTIFIER",
"CHARCONST", "ENCSTRINGCONST", "STRING", "ML_COMMENT",
"SL_COMMENT", "WS" ]
[docs]
RULE_description_content = 0
[docs]
RULE_encoding_entry = 7
[docs]
RULE_function_definition = 8
[docs]
RULE_parameter_list = 9
[docs]
RULE_parameter_declaration = 10
[docs]
RULE_switch_block_statement_group = 12
[docs]
RULE_for_condition = 16
[docs]
RULE_type_specifier = 18
[docs]
RULE_value_type_specifier = 19
[docs]
RULE_integer_signedness = 20
[docs]
RULE_integer_shorthand = 21
[docs]
RULE_float_shorthand = 22
[docs]
RULE_bit_size_specifier = 24
[docs]
RULE_enumerator_list = 25
[docs]
RULE_struct_declaration = 27
[docs]
RULE_struct_declaration_specifier = 28
[docs]
RULE_initializerList = 31
[docs]
RULE_designated_initializer = 32
[docs]
RULE_string_literal = 36
[docs]
RULE_integer_constant = 38
[docs]
RULE_floating_constant = 39
[docs]
RULE_bool_constant = 40
[docs]
RULE_character_constant = 41
[docs]
RULE_string_constant = 42
[docs]
RULE_double_left_bracket = 43
[docs]
RULE_double_right_bracket = 44
[docs]
RULE_type_qualifier = 46
[docs]
RULE_storage_class_specifier = 47
[docs]
RULE_struct_or_union = 48
[docs]
ruleNames = [ "description_content", "import_file", "isa", "section",
"always_block", "instruction", "rule_encoding", "encoding_entry",
"function_definition", "parameter_list", "parameter_declaration",
"statement", "switch_block_statement_group", "switch_label",
"block", "block_item", "for_condition", "declaration",
"type_specifier", "value_type_specifier", "integer_signedness",
"integer_shorthand", "float_shorthand", "attribute",
"bit_size_specifier", "enumerator_list", "enumerator",
"struct_declaration", "struct_declaration_specifier",
"declarator", "initializer", "initializerList", "designated_initializer",
"designator", "expression", "primary", "string_literal",
"constant", "integer_constant", "floating_constant",
"bool_constant", "character_constant", "string_constant",
"double_left_bracket", "double_right_bracket", "data_types",
"type_qualifier", "storage_class_specifier", "struct_or_union" ]
def __init__(self, input:TokenStream, output:TextIO = sys.stdout):
super().__init__(input, output)
self.checkVersion("4.13.1")
[docs]
self._interp = ParserATNSimulator(self, self.atn, self.decisionsToDFA, self.sharedContextCache)
[docs]
self._predicates = None
[docs]
class Description_contentContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
self._import_file = None # Import_fileContext
[docs]
self.imports = list() # of Import_fileContexts
[docs]
self._isa = None # IsaContext
[docs]
self.definitions = list() # of IsaContexts
[docs]
def import_file(self, i:int=None):
if i is None:
return self.getTypedRuleContexts(CoreDSL2Parser.Import_fileContext)
else:
return self.getTypedRuleContext(CoreDSL2Parser.Import_fileContext,i)
[docs]
def isa(self, i:int=None):
if i is None:
return self.getTypedRuleContexts(CoreDSL2Parser.IsaContext)
else:
return self.getTypedRuleContext(CoreDSL2Parser.IsaContext,i)
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_description_content
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterDescription_content" ):
listener.enterDescription_content(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitDescription_content" ):
listener.exitDescription_content(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitDescription_content" ):
return visitor.visitDescription_content(self)
else:
return visitor.visitChildren(self)
[docs]
def description_content(self):
localctx = CoreDSL2Parser.Description_contentContext(self, self._ctx, self.state)
self.enterRule(localctx, 0, self.RULE_description_content)
self._la = 0 # Token type
try:
self.enterOuterAlt(localctx, 1)
self.state = 101
self._errHandler.sync(self)
_la = self._input.LA(1)
while _la==1:
self.state = 98
localctx._import_file = self.import_file()
localctx.imports.append(localctx._import_file)
self.state = 103
self._errHandler.sync(self)
_la = self._input.LA(1)
self.state = 105
self._errHandler.sync(self)
_la = self._input.LA(1)
while True:
self.state = 104
localctx._isa = self.isa()
localctx.definitions.append(localctx._isa)
self.state = 107
self._errHandler.sync(self)
_la = self._input.LA(1)
if not (_la==2 or _la==7):
break
except RecognitionException as re:
localctx.exception = re
self._errHandler.reportError(self, re)
self._errHandler.recover(self, re)
finally:
self.exitRule()
return localctx
[docs]
class Import_fileContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
self.uri = None # Token
[docs]
def STRING(self):
return self.getToken(CoreDSL2Parser.STRING, 0)
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_import_file
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterImport_file" ):
listener.enterImport_file(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitImport_file" ):
listener.exitImport_file(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitImport_file" ):
return visitor.visitImport_file(self)
else:
return visitor.visitChildren(self)
[docs]
def import_file(self):
localctx = CoreDSL2Parser.Import_fileContext(self, self._ctx, self.state)
self.enterRule(localctx, 2, self.RULE_import_file)
try:
self.enterOuterAlt(localctx, 1)
self.state = 109
self.match(CoreDSL2Parser.T__0)
self.state = 110
localctx.uri = self.match(CoreDSL2Parser.STRING)
except RecognitionException as re:
localctx.exception = re
self._errHandler.reportError(self, re)
self._errHandler.recover(self, re)
finally:
self.exitRule()
return localctx
[docs]
class IsaContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_isa
[docs]
def copyFrom(self, ctx:ParserRuleContext):
super().copyFrom(ctx)
[docs]
class Instruction_setContext(IsaContext):
def __init__(self, parser, ctx:ParserRuleContext): # actually a CoreDSL2Parser.IsaContext
super().__init__(parser)
[docs]
self.name = None # Token
[docs]
self._IDENTIFIER = None # Token
[docs]
self.extension = list() # of Tokens
[docs]
self._section = None # SectionContext
[docs]
self.sections = list() # of SectionContexts
self.copyFrom(ctx)
[docs]
def IDENTIFIER(self, i:int=None):
if i is None:
return self.getTokens(CoreDSL2Parser.IDENTIFIER)
else:
return self.getToken(CoreDSL2Parser.IDENTIFIER, i)
[docs]
def section(self, i:int=None):
if i is None:
return self.getTypedRuleContexts(CoreDSL2Parser.SectionContext)
else:
return self.getTypedRuleContext(CoreDSL2Parser.SectionContext,i)
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterInstruction_set" ):
listener.enterInstruction_set(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitInstruction_set" ):
listener.exitInstruction_set(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitInstruction_set" ):
return visitor.visitInstruction_set(self)
else:
return visitor.visitChildren(self)
[docs]
class Core_defContext(IsaContext):
def __init__(self, parser, ctx:ParserRuleContext): # actually a CoreDSL2Parser.IsaContext
super().__init__(parser)
[docs]
self.name = None # Token
[docs]
self._IDENTIFIER = None # Token
[docs]
self.contributing_types = list() # of Tokens
[docs]
self._section = None # SectionContext
[docs]
self.sections = list() # of SectionContexts
self.copyFrom(ctx)
[docs]
def IDENTIFIER(self, i:int=None):
if i is None:
return self.getTokens(CoreDSL2Parser.IDENTIFIER)
else:
return self.getToken(CoreDSL2Parser.IDENTIFIER, i)
[docs]
def section(self, i:int=None):
if i is None:
return self.getTypedRuleContexts(CoreDSL2Parser.SectionContext)
else:
return self.getTypedRuleContext(CoreDSL2Parser.SectionContext,i)
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterCore_def" ):
listener.enterCore_def(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitCore_def" ):
listener.exitCore_def(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitCore_def" ):
return visitor.visitCore_def(self)
else:
return visitor.visitChildren(self)
[docs]
def isa(self):
localctx = CoreDSL2Parser.IsaContext(self, self._ctx, self.state)
self.enterRule(localctx, 4, self.RULE_isa)
self._la = 0 # Token type
try:
self.state = 154
self._errHandler.sync(self)
token = self._input.LA(1)
if token in [2]:
localctx = CoreDSL2Parser.Instruction_setContext(self, localctx)
self.enterOuterAlt(localctx, 1)
self.state = 112
self.match(CoreDSL2Parser.T__1)
self.state = 113
localctx.name = self.match(CoreDSL2Parser.IDENTIFIER)
self.state = 123
self._errHandler.sync(self)
_la = self._input.LA(1)
if _la==3:
self.state = 114
self.match(CoreDSL2Parser.T__2)
self.state = 115
localctx._IDENTIFIER = self.match(CoreDSL2Parser.IDENTIFIER)
localctx.extension.append(localctx._IDENTIFIER)
self.state = 120
self._errHandler.sync(self)
_la = self._input.LA(1)
while _la==4:
self.state = 116
self.match(CoreDSL2Parser.T__3)
self.state = 117
localctx._IDENTIFIER = self.match(CoreDSL2Parser.IDENTIFIER)
localctx.extension.append(localctx._IDENTIFIER)
self.state = 122
self._errHandler.sync(self)
_la = self._input.LA(1)
self.state = 125
self.match(CoreDSL2Parser.T__4)
self.state = 129
self._errHandler.sync(self)
_la = self._input.LA(1)
while (((_la) & ~0x3f) == 0 and ((1 << _la) & 14848) != 0):
self.state = 126
localctx._section = self.section()
localctx.sections.append(localctx._section)
self.state = 131
self._errHandler.sync(self)
_la = self._input.LA(1)
self.state = 132
self.match(CoreDSL2Parser.T__5)
pass
elif token in [7]:
localctx = CoreDSL2Parser.Core_defContext(self, localctx)
self.enterOuterAlt(localctx, 2)
self.state = 133
self.match(CoreDSL2Parser.T__6)
self.state = 134
localctx.name = self.match(CoreDSL2Parser.IDENTIFIER)
self.state = 144
self._errHandler.sync(self)
_la = self._input.LA(1)
if _la==8:
self.state = 135
self.match(CoreDSL2Parser.T__7)
self.state = 136
localctx._IDENTIFIER = self.match(CoreDSL2Parser.IDENTIFIER)
localctx.contributing_types.append(localctx._IDENTIFIER)
self.state = 141
self._errHandler.sync(self)
_la = self._input.LA(1)
while _la==4:
self.state = 137
self.match(CoreDSL2Parser.T__3)
self.state = 138
localctx._IDENTIFIER = self.match(CoreDSL2Parser.IDENTIFIER)
localctx.contributing_types.append(localctx._IDENTIFIER)
self.state = 143
self._errHandler.sync(self)
_la = self._input.LA(1)
self.state = 146
self.match(CoreDSL2Parser.T__4)
self.state = 150
self._errHandler.sync(self)
_la = self._input.LA(1)
while (((_la) & ~0x3f) == 0 and ((1 << _la) & 14848) != 0):
self.state = 147
localctx._section = self.section()
localctx.sections.append(localctx._section)
self.state = 152
self._errHandler.sync(self)
_la = self._input.LA(1)
self.state = 153
self.match(CoreDSL2Parser.T__5)
pass
else:
raise NoViableAltException(self)
except RecognitionException as re:
localctx.exception = re
self._errHandler.reportError(self, re)
self._errHandler.recover(self, re)
finally:
self.exitRule()
return localctx
[docs]
class SectionContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_section
[docs]
def copyFrom(self, ctx:ParserRuleContext):
super().copyFrom(ctx)
[docs]
class Section_instructionsContext(SectionContext):
def __init__(self, parser, ctx:ParserRuleContext): # actually a CoreDSL2Parser.SectionContext
super().__init__(parser)
[docs]
self.type_ = None # Token
[docs]
self._attribute = None # AttributeContext
[docs]
self.attributes = list() # of AttributeContexts
[docs]
self._instruction = None # InstructionContext
[docs]
self.instructions = list() # of InstructionContexts
self.copyFrom(ctx)
[docs]
def attribute(self, i:int=None):
if i is None:
return self.getTypedRuleContexts(CoreDSL2Parser.AttributeContext)
else:
return self.getTypedRuleContext(CoreDSL2Parser.AttributeContext,i)
[docs]
def instruction(self, i:int=None):
if i is None:
return self.getTypedRuleContexts(CoreDSL2Parser.InstructionContext)
else:
return self.getTypedRuleContext(CoreDSL2Parser.InstructionContext,i)
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterSection_instructions" ):
listener.enterSection_instructions(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitSection_instructions" ):
listener.exitSection_instructions(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitSection_instructions" ):
return visitor.visitSection_instructions(self)
else:
return visitor.visitChildren(self)
[docs]
class Section_alwaysContext(SectionContext):
def __init__(self, parser, ctx:ParserRuleContext): # actually a CoreDSL2Parser.SectionContext
super().__init__(parser)
[docs]
self.type_ = None # Token
[docs]
self._attribute = None # AttributeContext
[docs]
self.attributes = list() # of AttributeContexts
[docs]
self._always_block = None # Always_blockContext
[docs]
self.always_blocks = list() # of Always_blockContexts
self.copyFrom(ctx)
[docs]
def attribute(self, i:int=None):
if i is None:
return self.getTypedRuleContexts(CoreDSL2Parser.AttributeContext)
else:
return self.getTypedRuleContext(CoreDSL2Parser.AttributeContext,i)
[docs]
def always_block(self, i:int=None):
if i is None:
return self.getTypedRuleContexts(CoreDSL2Parser.Always_blockContext)
else:
return self.getTypedRuleContext(CoreDSL2Parser.Always_blockContext,i)
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterSection_always" ):
listener.enterSection_always(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitSection_always" ):
listener.exitSection_always(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitSection_always" ):
return visitor.visitSection_always(self)
else:
return visitor.visitChildren(self)
[docs]
class Section_functionsContext(SectionContext):
def __init__(self, parser, ctx:ParserRuleContext): # actually a CoreDSL2Parser.SectionContext
super().__init__(parser)
[docs]
self.type_ = None # Token
[docs]
self._function_definition = None # Function_definitionContext
[docs]
self.functions = list() # of Function_definitionContexts
self.copyFrom(ctx)
[docs]
def function_definition(self, i:int=None):
if i is None:
return self.getTypedRuleContexts(CoreDSL2Parser.Function_definitionContext)
else:
return self.getTypedRuleContext(CoreDSL2Parser.Function_definitionContext,i)
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterSection_functions" ):
listener.enterSection_functions(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitSection_functions" ):
listener.exitSection_functions(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitSection_functions" ):
return visitor.visitSection_functions(self)
else:
return visitor.visitChildren(self)
[docs]
class Section_arch_stateContext(SectionContext):
def __init__(self, parser, ctx:ParserRuleContext): # actually a CoreDSL2Parser.SectionContext
super().__init__(parser)
[docs]
self.type_ = None # Token
[docs]
self._declaration = None # DeclarationContext
[docs]
self.declarations = list() # of DeclarationContexts
[docs]
self._expression = None # ExpressionContext
[docs]
self.expressions = list() # of ExpressionContexts
self.copyFrom(ctx)
[docs]
def declaration(self, i:int=None):
if i is None:
return self.getTypedRuleContexts(CoreDSL2Parser.DeclarationContext)
else:
return self.getTypedRuleContext(CoreDSL2Parser.DeclarationContext,i)
[docs]
def expression(self, i:int=None):
if i is None:
return self.getTypedRuleContexts(CoreDSL2Parser.ExpressionContext)
else:
return self.getTypedRuleContext(CoreDSL2Parser.ExpressionContext,i)
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterSection_arch_state" ):
listener.enterSection_arch_state(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitSection_arch_state" ):
listener.exitSection_arch_state(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitSection_arch_state" ):
return visitor.visitSection_arch_state(self)
else:
return visitor.visitChildren(self)
[docs]
def section(self):
localctx = CoreDSL2Parser.SectionContext(self, self._ctx, self.state)
self.enterRule(localctx, 6, self.RULE_section)
self._la = 0 # Token type
try:
self.state = 207
self._errHandler.sync(self)
token = self._input.LA(1)
if token in [9]:
localctx = CoreDSL2Parser.Section_arch_stateContext(self, localctx)
self.enterOuterAlt(localctx, 1)
self.state = 156
localctx.type_ = self.match(CoreDSL2Parser.T__8)
self.state = 157
self.match(CoreDSL2Parser.T__4)
self.state = 162
self._errHandler.sync(self)
_la = self._input.LA(1)
while True:
self.state = 162
self._errHandler.sync(self)
token = self._input.LA(1)
if token in [19, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 85, 86, 87, 88, 89, 90]:
self.state = 158
localctx._declaration = self.declaration()
localctx.declarations.append(localctx._declaration)
pass
elif token in [20, 34, 35, 52, 53, 54, 55, 56, 57, 58, 59, 93, 94, 95, 96, 97, 98, 99]:
self.state = 159
localctx._expression = self.expression(0)
localctx.expressions.append(localctx._expression)
self.state = 160
self.match(CoreDSL2Parser.T__9)
pass
else:
raise NoViableAltException(self)
self.state = 164
self._errHandler.sync(self)
_la = self._input.LA(1)
if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & 1149543581549592576) != 0) or ((((_la - 85)) & ~0x3f) == 0 and ((1 << (_la - 85)) & 32575) != 0)):
break
self.state = 166
self.match(CoreDSL2Parser.T__5)
pass
elif token in [11]:
localctx = CoreDSL2Parser.Section_functionsContext(self, localctx)
self.enterOuterAlt(localctx, 2)
self.state = 168
localctx.type_ = self.match(CoreDSL2Parser.T__10)
self.state = 169
self.match(CoreDSL2Parser.T__4)
self.state = 171
self._errHandler.sync(self)
_la = self._input.LA(1)
while True:
self.state = 170
localctx._function_definition = self.function_definition()
localctx.functions.append(localctx._function_definition)
self.state = 173
self._errHandler.sync(self)
_la = self._input.LA(1)
if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & 562675076038656) != 0) or _la==89 or _la==90):
break
self.state = 175
self.match(CoreDSL2Parser.T__5)
pass
elif token in [12]:
localctx = CoreDSL2Parser.Section_instructionsContext(self, localctx)
self.enterOuterAlt(localctx, 3)
self.state = 177
localctx.type_ = self.match(CoreDSL2Parser.T__11)
self.state = 181
self._errHandler.sync(self)
_la = self._input.LA(1)
while _la==49:
self.state = 178
localctx._attribute = self.attribute()
localctx.attributes.append(localctx._attribute)
self.state = 183
self._errHandler.sync(self)
_la = self._input.LA(1)
self.state = 184
self.match(CoreDSL2Parser.T__4)
self.state = 188
self._errHandler.sync(self)
_la = self._input.LA(1)
while _la==96:
self.state = 185
localctx._instruction = self.instruction()
localctx.instructions.append(localctx._instruction)
self.state = 190
self._errHandler.sync(self)
_la = self._input.LA(1)
self.state = 191
self.match(CoreDSL2Parser.T__5)
pass
elif token in [13]:
localctx = CoreDSL2Parser.Section_alwaysContext(self, localctx)
self.enterOuterAlt(localctx, 4)
self.state = 192
localctx.type_ = self.match(CoreDSL2Parser.T__12)
self.state = 196
self._errHandler.sync(self)
_la = self._input.LA(1)
while _la==49:
self.state = 193
localctx._attribute = self.attribute()
localctx.attributes.append(localctx._attribute)
self.state = 198
self._errHandler.sync(self)
_la = self._input.LA(1)
self.state = 199
self.match(CoreDSL2Parser.T__4)
self.state = 201
self._errHandler.sync(self)
_la = self._input.LA(1)
while True:
self.state = 200
localctx._always_block = self.always_block()
localctx.always_blocks.append(localctx._always_block)
self.state = 203
self._errHandler.sync(self)
_la = self._input.LA(1)
if not (_la==96):
break
self.state = 205
self.match(CoreDSL2Parser.T__5)
pass
else:
raise NoViableAltException(self)
except RecognitionException as re:
localctx.exception = re
self._errHandler.reportError(self, re)
self._errHandler.recover(self, re)
finally:
self.exitRule()
return localctx
[docs]
class Always_blockContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
self.name = None # Token
[docs]
self._attribute = None # AttributeContext
[docs]
self.attributes = list() # of AttributeContexts
[docs]
self.behavior = None # BlockContext
[docs]
def IDENTIFIER(self):
return self.getToken(CoreDSL2Parser.IDENTIFIER, 0)
[docs]
def block(self):
return self.getTypedRuleContext(CoreDSL2Parser.BlockContext,0)
[docs]
def attribute(self, i:int=None):
if i is None:
return self.getTypedRuleContexts(CoreDSL2Parser.AttributeContext)
else:
return self.getTypedRuleContext(CoreDSL2Parser.AttributeContext,i)
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_always_block
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterAlways_block" ):
listener.enterAlways_block(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitAlways_block" ):
listener.exitAlways_block(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitAlways_block" ):
return visitor.visitAlways_block(self)
else:
return visitor.visitChildren(self)
[docs]
def always_block(self):
localctx = CoreDSL2Parser.Always_blockContext(self, self._ctx, self.state)
self.enterRule(localctx, 8, self.RULE_always_block)
self._la = 0 # Token type
try:
self.enterOuterAlt(localctx, 1)
self.state = 209
localctx.name = self.match(CoreDSL2Parser.IDENTIFIER)
self.state = 213
self._errHandler.sync(self)
_la = self._input.LA(1)
while _la==49:
self.state = 210
localctx._attribute = self.attribute()
localctx.attributes.append(localctx._attribute)
self.state = 215
self._errHandler.sync(self)
_la = self._input.LA(1)
self.state = 216
localctx.behavior = self.block()
except RecognitionException as re:
localctx.exception = re
self._errHandler.reportError(self, re)
self._errHandler.recover(self, re)
finally:
self.exitRule()
return localctx
[docs]
class InstructionContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
self.name = None # Token
[docs]
self._attribute = None # AttributeContext
[docs]
self.attributes = list() # of AttributeContexts
[docs]
self._encoding_entry = None # Encoding_entryContext
[docs]
self.encoding = list() # of Encoding_entryContexts
[docs]
self.assembly = None # Token
[docs]
self.mnemonic = None # Token
[docs]
self.behavior = None # StatementContext
[docs]
def IDENTIFIER(self):
return self.getToken(CoreDSL2Parser.IDENTIFIER, 0)
[docs]
def encoding_entry(self, i:int=None):
if i is None:
return self.getTypedRuleContexts(CoreDSL2Parser.Encoding_entryContext)
else:
return self.getTypedRuleContext(CoreDSL2Parser.Encoding_entryContext,i)
[docs]
def statement(self):
return self.getTypedRuleContext(CoreDSL2Parser.StatementContext,0)
[docs]
def attribute(self, i:int=None):
if i is None:
return self.getTypedRuleContexts(CoreDSL2Parser.AttributeContext)
else:
return self.getTypedRuleContext(CoreDSL2Parser.AttributeContext,i)
[docs]
def STRING(self, i:int=None):
if i is None:
return self.getTokens(CoreDSL2Parser.STRING)
else:
return self.getToken(CoreDSL2Parser.STRING, i)
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_instruction
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterInstruction" ):
listener.enterInstruction(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitInstruction" ):
listener.exitInstruction(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitInstruction" ):
return visitor.visitInstruction(self)
else:
return visitor.visitChildren(self)
[docs]
def instruction(self):
localctx = CoreDSL2Parser.InstructionContext(self, self._ctx, self.state)
self.enterRule(localctx, 10, self.RULE_instruction)
self._la = 0 # Token type
try:
self.enterOuterAlt(localctx, 1)
self.state = 218
localctx.name = self.match(CoreDSL2Parser.IDENTIFIER)
self.state = 222
self._errHandler.sync(self)
_la = self._input.LA(1)
while _la==49:
self.state = 219
localctx._attribute = self.attribute()
localctx.attributes.append(localctx._attribute)
self.state = 224
self._errHandler.sync(self)
_la = self._input.LA(1)
self.state = 225
self.match(CoreDSL2Parser.T__4)
self.state = 226
self.match(CoreDSL2Parser.T__13)
self.state = 227
self.match(CoreDSL2Parser.T__14)
self.state = 228
localctx._encoding_entry = self.encoding_entry()
localctx.encoding.append(localctx._encoding_entry)
self.state = 233
self._errHandler.sync(self)
_la = self._input.LA(1)
while _la==16:
self.state = 229
self.match(CoreDSL2Parser.T__15)
self.state = 230
localctx._encoding_entry = self.encoding_entry()
localctx.encoding.append(localctx._encoding_entry)
self.state = 235
self._errHandler.sync(self)
_la = self._input.LA(1)
self.state = 236
self.match(CoreDSL2Parser.T__9)
self.state = 248
self._errHandler.sync(self)
_la = self._input.LA(1)
if _la==17:
self.state = 237
self.match(CoreDSL2Parser.T__16)
self.state = 238
self.match(CoreDSL2Parser.T__14)
self.state = 245
self._errHandler.sync(self)
token = self._input.LA(1)
if token in [99]:
self.state = 239
localctx.assembly = self.match(CoreDSL2Parser.STRING)
pass
elif token in [5]:
self.state = 240
self.match(CoreDSL2Parser.T__4)
self.state = 241
localctx.mnemonic = self.match(CoreDSL2Parser.STRING)
self.state = 242
self.match(CoreDSL2Parser.T__3)
self.state = 243
localctx.assembly = self.match(CoreDSL2Parser.STRING)
self.state = 244
self.match(CoreDSL2Parser.T__5)
pass
else:
raise NoViableAltException(self)
self.state = 247
self.match(CoreDSL2Parser.T__9)
self.state = 250
self.match(CoreDSL2Parser.T__17)
self.state = 251
self.match(CoreDSL2Parser.T__14)
self.state = 252
localctx.behavior = self.statement()
self.state = 253
self.match(CoreDSL2Parser.T__5)
except RecognitionException as re:
localctx.exception = re
self._errHandler.reportError(self, re)
self._errHandler.recover(self, re)
finally:
self.exitRule()
return localctx
[docs]
class Rule_encodingContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
self._encoding_entry = None # Encoding_entryContext
[docs]
self.fields = list() # of Encoding_entryContexts
[docs]
def encoding_entry(self, i:int=None):
if i is None:
return self.getTypedRuleContexts(CoreDSL2Parser.Encoding_entryContext)
else:
return self.getTypedRuleContext(CoreDSL2Parser.Encoding_entryContext,i)
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_rule_encoding
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterRule_encoding" ):
listener.enterRule_encoding(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitRule_encoding" ):
listener.exitRule_encoding(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitRule_encoding" ):
return visitor.visitRule_encoding(self)
else:
return visitor.visitChildren(self)
[docs]
def rule_encoding(self):
localctx = CoreDSL2Parser.Rule_encodingContext(self, self._ctx, self.state)
self.enterRule(localctx, 12, self.RULE_rule_encoding)
self._la = 0 # Token type
try:
self.enterOuterAlt(localctx, 1)
self.state = 255
localctx._encoding_entry = self.encoding_entry()
localctx.fields.append(localctx._encoding_entry)
self.state = 260
self._errHandler.sync(self)
_la = self._input.LA(1)
while _la==16:
self.state = 256
self.match(CoreDSL2Parser.T__15)
self.state = 257
localctx._encoding_entry = self.encoding_entry()
localctx.fields.append(localctx._encoding_entry)
self.state = 262
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
[docs]
class Encoding_entryContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_encoding_entry
[docs]
def copyFrom(self, ctx:ParserRuleContext):
super().copyFrom(ctx)
[docs]
class Bit_fieldContext(Encoding_entryContext):
def __init__(self, parser, ctx:ParserRuleContext): # actually a CoreDSL2Parser.Encoding_entryContext
super().__init__(parser)
[docs]
self.name = None # Token
[docs]
self.left = None # Integer_constantContext
[docs]
self.right = None # Integer_constantContext
self.copyFrom(ctx)
[docs]
def LEFT_BR(self):
return self.getToken(CoreDSL2Parser.LEFT_BR, 0)
[docs]
def RIGHT_BR(self):
return self.getToken(CoreDSL2Parser.RIGHT_BR, 0)
[docs]
def IDENTIFIER(self):
return self.getToken(CoreDSL2Parser.IDENTIFIER, 0)
[docs]
def integer_constant(self, i:int=None):
if i is None:
return self.getTypedRuleContexts(CoreDSL2Parser.Integer_constantContext)
else:
return self.getTypedRuleContext(CoreDSL2Parser.Integer_constantContext,i)
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterBit_field" ):
listener.enterBit_field(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitBit_field" ):
listener.exitBit_field(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitBit_field" ):
return visitor.visitBit_field(self)
else:
return visitor.visitChildren(self)
[docs]
class Bit_valueContext(Encoding_entryContext):
def __init__(self, parser, ctx:ParserRuleContext): # actually a CoreDSL2Parser.Encoding_entryContext
super().__init__(parser)
[docs]
self.value = None # Integer_constantContext
self.copyFrom(ctx)
[docs]
def integer_constant(self):
return self.getTypedRuleContext(CoreDSL2Parser.Integer_constantContext,0)
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterBit_value" ):
listener.enterBit_value(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitBit_value" ):
listener.exitBit_value(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitBit_value" ):
return visitor.visitBit_value(self)
else:
return visitor.visitChildren(self)
[docs]
def encoding_entry(self):
localctx = CoreDSL2Parser.Encoding_entryContext(self, self._ctx, self.state)
self.enterRule(localctx, 14, self.RULE_encoding_entry)
try:
self.state = 271
self._errHandler.sync(self)
token = self._input.LA(1)
if token in [95]:
localctx = CoreDSL2Parser.Bit_valueContext(self, localctx)
self.enterOuterAlt(localctx, 1)
self.state = 263
localctx.value = self.integer_constant()
pass
elif token in [96]:
localctx = CoreDSL2Parser.Bit_fieldContext(self, localctx)
self.enterOuterAlt(localctx, 2)
self.state = 264
localctx.name = self.match(CoreDSL2Parser.IDENTIFIER)
self.state = 265
self.match(CoreDSL2Parser.LEFT_BR)
self.state = 266
localctx.left = self.integer_constant()
self.state = 267
self.match(CoreDSL2Parser.T__14)
self.state = 268
localctx.right = self.integer_constant()
self.state = 269
self.match(CoreDSL2Parser.RIGHT_BR)
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
[docs]
class Function_definitionContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
self.extern = None # Token
[docs]
self.type_ = None # Type_specifierContext
[docs]
self.name = None # Token
[docs]
self.params = None # Parameter_listContext
[docs]
self._attribute = None # AttributeContext
[docs]
self.attributes = list() # of AttributeContexts
[docs]
self.behavior = None # BlockContext
[docs]
def type_specifier(self):
return self.getTypedRuleContext(CoreDSL2Parser.Type_specifierContext,0)
[docs]
def IDENTIFIER(self):
return self.getToken(CoreDSL2Parser.IDENTIFIER, 0)
[docs]
def parameter_list(self):
return self.getTypedRuleContext(CoreDSL2Parser.Parameter_listContext,0)
[docs]
def attribute(self, i:int=None):
if i is None:
return self.getTypedRuleContexts(CoreDSL2Parser.AttributeContext)
else:
return self.getTypedRuleContext(CoreDSL2Parser.AttributeContext,i)
[docs]
def block(self):
return self.getTypedRuleContext(CoreDSL2Parser.BlockContext,0)
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_function_definition
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterFunction_definition" ):
listener.enterFunction_definition(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitFunction_definition" ):
listener.exitFunction_definition(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitFunction_definition" ):
return visitor.visitFunction_definition(self)
else:
return visitor.visitChildren(self)
[docs]
def function_definition(self):
localctx = CoreDSL2Parser.Function_definitionContext(self, self._ctx, self.state)
self.enterRule(localctx, 16, self.RULE_function_definition)
self._la = 0 # Token type
try:
self.state = 306
self._errHandler.sync(self)
token = self._input.LA(1)
if token in [19]:
self.enterOuterAlt(localctx, 1)
self.state = 273
localctx.extern = self.match(CoreDSL2Parser.T__18)
self.state = 274
localctx.type_ = self.type_specifier()
self.state = 275
localctx.name = self.match(CoreDSL2Parser.IDENTIFIER)
self.state = 276
self.match(CoreDSL2Parser.T__19)
self.state = 278
self._errHandler.sync(self)
_la = self._input.LA(1)
if ((((_la - 38)) & ~0x3f) == 0 and ((1 << (_la - 38)) & 6755399441057791) != 0):
self.state = 277
localctx.params = self.parameter_list()
self.state = 280
self.match(CoreDSL2Parser.T__20)
self.state = 284
self._errHandler.sync(self)
_la = self._input.LA(1)
while _la==49:
self.state = 281
localctx._attribute = self.attribute()
localctx.attributes.append(localctx._attribute)
self.state = 286
self._errHandler.sync(self)
_la = self._input.LA(1)
self.state = 287
self.match(CoreDSL2Parser.T__9)
pass
elif token in [38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 89, 90]:
self.enterOuterAlt(localctx, 2)
self.state = 289
localctx.type_ = self.type_specifier()
self.state = 290
localctx.name = self.match(CoreDSL2Parser.IDENTIFIER)
self.state = 291
self.match(CoreDSL2Parser.T__19)
self.state = 293
self._errHandler.sync(self)
_la = self._input.LA(1)
if ((((_la - 38)) & ~0x3f) == 0 and ((1 << (_la - 38)) & 6755399441057791) != 0):
self.state = 292
localctx.params = self.parameter_list()
self.state = 295
self.match(CoreDSL2Parser.T__20)
self.state = 299
self._errHandler.sync(self)
_la = self._input.LA(1)
while _la==49:
self.state = 296
localctx._attribute = self.attribute()
localctx.attributes.append(localctx._attribute)
self.state = 301
self._errHandler.sync(self)
_la = self._input.LA(1)
self.state = 304
self._errHandler.sync(self)
token = self._input.LA(1)
if token in [5]:
self.state = 302
localctx.behavior = self.block()
pass
elif token in [10]:
self.state = 303
self.match(CoreDSL2Parser.T__9)
pass
else:
raise NoViableAltException(self)
pass
else:
raise NoViableAltException(self)
except RecognitionException as re:
localctx.exception = re
self._errHandler.reportError(self, re)
self._errHandler.recover(self, re)
finally:
self.exitRule()
return localctx
[docs]
class Parameter_listContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
self._parameter_declaration = None # Parameter_declarationContext
[docs]
self.params = list() # of Parameter_declarationContexts
[docs]
def parameter_declaration(self, i:int=None):
if i is None:
return self.getTypedRuleContexts(CoreDSL2Parser.Parameter_declarationContext)
else:
return self.getTypedRuleContext(CoreDSL2Parser.Parameter_declarationContext,i)
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_parameter_list
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterParameter_list" ):
listener.enterParameter_list(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitParameter_list" ):
listener.exitParameter_list(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitParameter_list" ):
return visitor.visitParameter_list(self)
else:
return visitor.visitChildren(self)
[docs]
def parameter_list(self):
localctx = CoreDSL2Parser.Parameter_listContext(self, self._ctx, self.state)
self.enterRule(localctx, 18, self.RULE_parameter_list)
self._la = 0 # Token type
try:
self.enterOuterAlt(localctx, 1)
self.state = 308
localctx._parameter_declaration = self.parameter_declaration()
localctx.params.append(localctx._parameter_declaration)
self.state = 313
self._errHandler.sync(self)
_la = self._input.LA(1)
while _la==4:
self.state = 309
self.match(CoreDSL2Parser.T__3)
self.state = 310
localctx._parameter_declaration = self.parameter_declaration()
localctx.params.append(localctx._parameter_declaration)
self.state = 315
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
[docs]
class Parameter_declarationContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
self.type_ = None # Type_specifierContext
[docs]
self.decl = None # DeclaratorContext
[docs]
def type_specifier(self):
return self.getTypedRuleContext(CoreDSL2Parser.Type_specifierContext,0)
[docs]
def declarator(self):
return self.getTypedRuleContext(CoreDSL2Parser.DeclaratorContext,0)
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_parameter_declaration
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterParameter_declaration" ):
listener.enterParameter_declaration(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitParameter_declaration" ):
listener.exitParameter_declaration(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitParameter_declaration" ):
return visitor.visitParameter_declaration(self)
else:
return visitor.visitChildren(self)
[docs]
def parameter_declaration(self):
localctx = CoreDSL2Parser.Parameter_declarationContext(self, self._ctx, self.state)
self.enterRule(localctx, 20, self.RULE_parameter_declaration)
self._la = 0 # Token type
try:
self.enterOuterAlt(localctx, 1)
self.state = 316
localctx.type_ = self.type_specifier()
self.state = 318
self._errHandler.sync(self)
_la = self._input.LA(1)
if _la==96:
self.state = 317
localctx.decl = self.declarator()
except RecognitionException as re:
localctx.exception = re
self._errHandler.reportError(self, re)
self._errHandler.recover(self, re)
finally:
self.exitRule()
return localctx
[docs]
class StatementContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_statement
[docs]
def copyFrom(self, ctx:ParserRuleContext):
super().copyFrom(ctx)
[docs]
class For_statementContext(StatementContext):
def __init__(self, parser, ctx:ParserRuleContext): # actually a CoreDSL2Parser.StatementContext
super().__init__(parser)
[docs]
self.type_ = None # Token
[docs]
self.cond = None # For_conditionContext
[docs]
self.stmt = None # StatementContext
self.copyFrom(ctx)
[docs]
def for_condition(self):
return self.getTypedRuleContext(CoreDSL2Parser.For_conditionContext,0)
[docs]
def statement(self):
return self.getTypedRuleContext(CoreDSL2Parser.StatementContext,0)
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterFor_statement" ):
listener.enterFor_statement(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitFor_statement" ):
listener.exitFor_statement(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitFor_statement" ):
return visitor.visitFor_statement(self)
else:
return visitor.visitChildren(self)
[docs]
class Spawn_statementContext(StatementContext):
def __init__(self, parser, ctx:ParserRuleContext): # actually a CoreDSL2Parser.StatementContext
super().__init__(parser)
[docs]
self.type_ = None # Token
[docs]
self.stmt = None # StatementContext
self.copyFrom(ctx)
[docs]
def statement(self):
return self.getTypedRuleContext(CoreDSL2Parser.StatementContext,0)
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterSpawn_statement" ):
listener.enterSpawn_statement(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitSpawn_statement" ):
listener.exitSpawn_statement(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitSpawn_statement" ):
return visitor.visitSpawn_statement(self)
else:
return visitor.visitChildren(self)
[docs]
class Continue_statementContext(StatementContext):
def __init__(self, parser, ctx:ParserRuleContext): # actually a CoreDSL2Parser.StatementContext
super().__init__(parser)
[docs]
self.type_ = None # Token
self.copyFrom(ctx)
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterContinue_statement" ):
listener.enterContinue_statement(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitContinue_statement" ):
listener.exitContinue_statement(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitContinue_statement" ):
return visitor.visitContinue_statement(self)
else:
return visitor.visitChildren(self)
[docs]
class Expression_statementContext(StatementContext):
def __init__(self, parser, ctx:ParserRuleContext): # actually a CoreDSL2Parser.StatementContext
super().__init__(parser)
[docs]
self.expr = None # ExpressionContext
self.copyFrom(ctx)
[docs]
def expression(self):
return self.getTypedRuleContext(CoreDSL2Parser.ExpressionContext,0)
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterExpression_statement" ):
listener.enterExpression_statement(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitExpression_statement" ):
listener.exitExpression_statement(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitExpression_statement" ):
return visitor.visitExpression_statement(self)
else:
return visitor.visitChildren(self)
[docs]
class If_statementContext(StatementContext):
def __init__(self, parser, ctx:ParserRuleContext): # actually a CoreDSL2Parser.StatementContext
super().__init__(parser)
[docs]
self.type_ = None # Token
[docs]
self._expression = None # ExpressionContext
[docs]
self.cond = list() # of ExpressionContexts
[docs]
self._statement = None # StatementContext
[docs]
self.stmt = list() # of StatementContexts
self.copyFrom(ctx)
[docs]
def expression(self, i:int=None):
if i is None:
return self.getTypedRuleContexts(CoreDSL2Parser.ExpressionContext)
else:
return self.getTypedRuleContext(CoreDSL2Parser.ExpressionContext,i)
[docs]
def statement(self, i:int=None):
if i is None:
return self.getTypedRuleContexts(CoreDSL2Parser.StatementContext)
else:
return self.getTypedRuleContext(CoreDSL2Parser.StatementContext,i)
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterIf_statement" ):
listener.enterIf_statement(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitIf_statement" ):
listener.exitIf_statement(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitIf_statement" ):
return visitor.visitIf_statement(self)
else:
return visitor.visitChildren(self)
[docs]
class Procedure_callContext(StatementContext):
def __init__(self, parser, ctx:ParserRuleContext): # actually a CoreDSL2Parser.StatementContext
super().__init__(parser)
[docs]
self.ref = None # Token
[docs]
self._expression = None # ExpressionContext
[docs]
self.args = list() # of ExpressionContexts
self.copyFrom(ctx)
[docs]
def IDENTIFIER(self):
return self.getToken(CoreDSL2Parser.IDENTIFIER, 0)
[docs]
def expression(self, i:int=None):
if i is None:
return self.getTypedRuleContexts(CoreDSL2Parser.ExpressionContext)
else:
return self.getTypedRuleContext(CoreDSL2Parser.ExpressionContext,i)
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterProcedure_call" ):
listener.enterProcedure_call(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitProcedure_call" ):
listener.exitProcedure_call(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitProcedure_call" ):
return visitor.visitProcedure_call(self)
else:
return visitor.visitChildren(self)
[docs]
class While_statementContext(StatementContext):
def __init__(self, parser, ctx:ParserRuleContext): # actually a CoreDSL2Parser.StatementContext
super().__init__(parser)
[docs]
self.type_ = None # Token
[docs]
self.cond = None # ExpressionContext
[docs]
self.stmt = None # StatementContext
self.copyFrom(ctx)
[docs]
def expression(self):
return self.getTypedRuleContext(CoreDSL2Parser.ExpressionContext,0)
[docs]
def statement(self):
return self.getTypedRuleContext(CoreDSL2Parser.StatementContext,0)
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterWhile_statement" ):
listener.enterWhile_statement(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitWhile_statement" ):
listener.exitWhile_statement(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitWhile_statement" ):
return visitor.visitWhile_statement(self)
else:
return visitor.visitChildren(self)
[docs]
class Switch_statementContext(StatementContext):
def __init__(self, parser, ctx:ParserRuleContext): # actually a CoreDSL2Parser.StatementContext
super().__init__(parser)
[docs]
self.type_ = None # Token
[docs]
self.cond = None # ExpressionContext
[docs]
self._switch_block_statement_group = None # Switch_block_statement_groupContext
[docs]
self.items = list() # of Switch_block_statement_groupContexts
self.copyFrom(ctx)
[docs]
def expression(self):
return self.getTypedRuleContext(CoreDSL2Parser.ExpressionContext,0)
[docs]
def switch_label(self, i:int=None):
if i is None:
return self.getTypedRuleContexts(CoreDSL2Parser.Switch_labelContext)
else:
return self.getTypedRuleContext(CoreDSL2Parser.Switch_labelContext,i)
[docs]
def switch_block_statement_group(self, i:int=None):
if i is None:
return self.getTypedRuleContexts(CoreDSL2Parser.Switch_block_statement_groupContext)
else:
return self.getTypedRuleContext(CoreDSL2Parser.Switch_block_statement_groupContext,i)
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterSwitch_statement" ):
listener.enterSwitch_statement(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitSwitch_statement" ):
listener.exitSwitch_statement(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitSwitch_statement" ):
return visitor.visitSwitch_statement(self)
else:
return visitor.visitChildren(self)
[docs]
class Block_statementContext(StatementContext):
def __init__(self, parser, ctx:ParserRuleContext): # actually a CoreDSL2Parser.StatementContext
super().__init__(parser)
self.copyFrom(ctx)
[docs]
def block(self):
return self.getTypedRuleContext(CoreDSL2Parser.BlockContext,0)
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterBlock_statement" ):
listener.enterBlock_statement(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitBlock_statement" ):
listener.exitBlock_statement(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitBlock_statement" ):
return visitor.visitBlock_statement(self)
else:
return visitor.visitChildren(self)
[docs]
class Do_statementContext(StatementContext):
def __init__(self, parser, ctx:ParserRuleContext): # actually a CoreDSL2Parser.StatementContext
super().__init__(parser)
[docs]
self.type_ = None # Token
[docs]
self.stmt = None # StatementContext
[docs]
self.cond = None # ExpressionContext
self.copyFrom(ctx)
[docs]
def statement(self):
return self.getTypedRuleContext(CoreDSL2Parser.StatementContext,0)
[docs]
def expression(self):
return self.getTypedRuleContext(CoreDSL2Parser.ExpressionContext,0)
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterDo_statement" ):
listener.enterDo_statement(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitDo_statement" ):
listener.exitDo_statement(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitDo_statement" ):
return visitor.visitDo_statement(self)
else:
return visitor.visitChildren(self)
[docs]
class Break_statementContext(StatementContext):
def __init__(self, parser, ctx:ParserRuleContext): # actually a CoreDSL2Parser.StatementContext
super().__init__(parser)
[docs]
self.type_ = None # Token
self.copyFrom(ctx)
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterBreak_statement" ):
listener.enterBreak_statement(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitBreak_statement" ):
listener.exitBreak_statement(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitBreak_statement" ):
return visitor.visitBreak_statement(self)
else:
return visitor.visitChildren(self)
[docs]
class Return_statementContext(StatementContext):
def __init__(self, parser, ctx:ParserRuleContext): # actually a CoreDSL2Parser.StatementContext
super().__init__(parser)
[docs]
self.type_ = None # Token
[docs]
self.expr = None # ExpressionContext
self.copyFrom(ctx)
[docs]
def expression(self):
return self.getTypedRuleContext(CoreDSL2Parser.ExpressionContext,0)
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterReturn_statement" ):
listener.enterReturn_statement(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitReturn_statement" ):
listener.exitReturn_statement(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitReturn_statement" ):
return visitor.visitReturn_statement(self)
else:
return visitor.visitChildren(self)
[docs]
def statement(self):
localctx = CoreDSL2Parser.StatementContext(self, self._ctx, self.state)
self.enterRule(localctx, 22, self.RULE_statement)
self._la = 0 # Token type
try:
self.state = 409
self._errHandler.sync(self)
la_ = self._interp.adaptivePredict(self._input,39,self._ctx)
if la_ == 1:
localctx = CoreDSL2Parser.Block_statementContext(self, localctx)
self.enterOuterAlt(localctx, 1)
self.state = 320
self.block()
pass
elif la_ == 2:
localctx = CoreDSL2Parser.Procedure_callContext(self, localctx)
self.enterOuterAlt(localctx, 2)
self.state = 321
localctx.ref = self.match(CoreDSL2Parser.IDENTIFIER)
self.state = 322
self.match(CoreDSL2Parser.T__19)
self.state = 331
self._errHandler.sync(self)
_la = self._input.LA(1)
if (((_la) & ~0x3f) == 0 and ((1 << _la) & 1148417956520132608) != 0) or ((((_la - 93)) & ~0x3f) == 0 and ((1 << (_la - 93)) & 127) != 0):
self.state = 323
localctx._expression = self.expression(0)
localctx.args.append(localctx._expression)
self.state = 328
self._errHandler.sync(self)
_la = self._input.LA(1)
while _la==4:
self.state = 324
self.match(CoreDSL2Parser.T__3)
self.state = 325
localctx._expression = self.expression(0)
localctx.args.append(localctx._expression)
self.state = 330
self._errHandler.sync(self)
_la = self._input.LA(1)
self.state = 333
self.match(CoreDSL2Parser.T__20)
self.state = 334
self.match(CoreDSL2Parser.T__9)
pass
elif la_ == 3:
localctx = CoreDSL2Parser.If_statementContext(self, localctx)
self.enterOuterAlt(localctx, 3)
self.state = 335
localctx.type_ = self.match(CoreDSL2Parser.T__21)
self.state = 336
self.match(CoreDSL2Parser.T__19)
self.state = 337
localctx._expression = self.expression(0)
localctx.cond.append(localctx._expression)
self.state = 338
self.match(CoreDSL2Parser.T__20)
self.state = 339
localctx._statement = self.statement()
localctx.stmt.append(localctx._statement)
self.state = 349
self._errHandler.sync(self)
_alt = self._interp.adaptivePredict(self._input,34,self._ctx)
while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
if _alt==1:
self.state = 340
self.match(CoreDSL2Parser.T__22)
self.state = 341
self.match(CoreDSL2Parser.T__21)
self.state = 342
self.match(CoreDSL2Parser.T__19)
self.state = 343
localctx._expression = self.expression(0)
localctx.cond.append(localctx._expression)
self.state = 344
self.match(CoreDSL2Parser.T__20)
self.state = 345
localctx._statement = self.statement()
localctx.stmt.append(localctx._statement)
self.state = 351
self._errHandler.sync(self)
_alt = self._interp.adaptivePredict(self._input,34,self._ctx)
self.state = 354
self._errHandler.sync(self)
la_ = self._interp.adaptivePredict(self._input,35,self._ctx)
if la_ == 1:
self.state = 352
self.match(CoreDSL2Parser.T__22)
self.state = 353
localctx._statement = self.statement()
localctx.stmt.append(localctx._statement)
pass
elif la_ == 4:
localctx = CoreDSL2Parser.For_statementContext(self, localctx)
self.enterOuterAlt(localctx, 4)
self.state = 356
localctx.type_ = self.match(CoreDSL2Parser.T__23)
self.state = 357
self.match(CoreDSL2Parser.T__19)
self.state = 358
localctx.cond = self.for_condition()
self.state = 359
self.match(CoreDSL2Parser.T__20)
self.state = 360
localctx.stmt = self.statement()
pass
elif la_ == 5:
localctx = CoreDSL2Parser.While_statementContext(self, localctx)
self.enterOuterAlt(localctx, 5)
self.state = 362
localctx.type_ = self.match(CoreDSL2Parser.T__24)
self.state = 363
self.match(CoreDSL2Parser.T__19)
self.state = 364
localctx.cond = self.expression(0)
self.state = 365
self.match(CoreDSL2Parser.T__20)
self.state = 366
localctx.stmt = self.statement()
pass
elif la_ == 6:
localctx = CoreDSL2Parser.Do_statementContext(self, localctx)
self.enterOuterAlt(localctx, 6)
self.state = 368
localctx.type_ = self.match(CoreDSL2Parser.T__25)
self.state = 369
localctx.stmt = self.statement()
self.state = 370
self.match(CoreDSL2Parser.T__24)
self.state = 371
self.match(CoreDSL2Parser.T__19)
self.state = 372
localctx.cond = self.expression(0)
self.state = 373
self.match(CoreDSL2Parser.T__20)
self.state = 374
self.match(CoreDSL2Parser.T__9)
pass
elif la_ == 7:
localctx = CoreDSL2Parser.Switch_statementContext(self, localctx)
self.enterOuterAlt(localctx, 7)
self.state = 376
localctx.type_ = self.match(CoreDSL2Parser.T__26)
self.state = 377
self.match(CoreDSL2Parser.T__19)
self.state = 378
localctx.cond = self.expression(0)
self.state = 379
self.match(CoreDSL2Parser.T__20)
self.state = 380
self.match(CoreDSL2Parser.T__4)
self.state = 384
self._errHandler.sync(self)
_alt = self._interp.adaptivePredict(self._input,36,self._ctx)
while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
if _alt==1:
self.state = 381
localctx._switch_block_statement_group = self.switch_block_statement_group()
localctx.items.append(localctx._switch_block_statement_group)
self.state = 386
self._errHandler.sync(self)
_alt = self._interp.adaptivePredict(self._input,36,self._ctx)
self.state = 390
self._errHandler.sync(self)
_la = self._input.LA(1)
while _la==32 or _la==33:
self.state = 387
self.switch_label()
self.state = 392
self._errHandler.sync(self)
_la = self._input.LA(1)
self.state = 393
self.match(CoreDSL2Parser.T__5)
pass
elif la_ == 8:
localctx = CoreDSL2Parser.Return_statementContext(self, localctx)
self.enterOuterAlt(localctx, 8)
self.state = 395
localctx.type_ = self.match(CoreDSL2Parser.T__27)
self.state = 397
self._errHandler.sync(self)
_la = self._input.LA(1)
if (((_la) & ~0x3f) == 0 and ((1 << _la) & 1148417956520132608) != 0) or ((((_la - 93)) & ~0x3f) == 0 and ((1 << (_la - 93)) & 127) != 0):
self.state = 396
localctx.expr = self.expression(0)
self.state = 399
self.match(CoreDSL2Parser.T__9)
pass
elif la_ == 9:
localctx = CoreDSL2Parser.Break_statementContext(self, localctx)
self.enterOuterAlt(localctx, 9)
self.state = 400
localctx.type_ = self.match(CoreDSL2Parser.T__28)
self.state = 401
self.match(CoreDSL2Parser.T__9)
pass
elif la_ == 10:
localctx = CoreDSL2Parser.Continue_statementContext(self, localctx)
self.enterOuterAlt(localctx, 10)
self.state = 402
localctx.type_ = self.match(CoreDSL2Parser.T__29)
self.state = 403
self.match(CoreDSL2Parser.T__9)
pass
elif la_ == 11:
localctx = CoreDSL2Parser.Spawn_statementContext(self, localctx)
self.enterOuterAlt(localctx, 11)
self.state = 404
localctx.type_ = self.match(CoreDSL2Parser.T__30)
self.state = 405
localctx.stmt = self.statement()
pass
elif la_ == 12:
localctx = CoreDSL2Parser.Expression_statementContext(self, localctx)
self.enterOuterAlt(localctx, 12)
self.state = 406
localctx.expr = self.expression(0)
self.state = 407
self.match(CoreDSL2Parser.T__9)
pass
except RecognitionException as re:
localctx.exception = re
self._errHandler.reportError(self, re)
self._errHandler.recover(self, re)
finally:
self.exitRule()
return localctx
[docs]
class Switch_block_statement_groupContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
self._switch_label = None # Switch_labelContext
[docs]
self.labels = list() # of Switch_labelContexts
[docs]
self._statement = None # StatementContext
[docs]
self.statements = list() # of StatementContexts
[docs]
def switch_label(self, i:int=None):
if i is None:
return self.getTypedRuleContexts(CoreDSL2Parser.Switch_labelContext)
else:
return self.getTypedRuleContext(CoreDSL2Parser.Switch_labelContext,i)
[docs]
def statement(self, i:int=None):
if i is None:
return self.getTypedRuleContexts(CoreDSL2Parser.StatementContext)
else:
return self.getTypedRuleContext(CoreDSL2Parser.StatementContext,i)
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_switch_block_statement_group
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterSwitch_block_statement_group" ):
listener.enterSwitch_block_statement_group(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitSwitch_block_statement_group" ):
listener.exitSwitch_block_statement_group(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitSwitch_block_statement_group" ):
return visitor.visitSwitch_block_statement_group(self)
else:
return visitor.visitChildren(self)
[docs]
def switch_block_statement_group(self):
localctx = CoreDSL2Parser.Switch_block_statement_groupContext(self, self._ctx, self.state)
self.enterRule(localctx, 24, self.RULE_switch_block_statement_group)
self._la = 0 # Token type
try:
self.enterOuterAlt(localctx, 1)
self.state = 412
self._errHandler.sync(self)
_la = self._input.LA(1)
while True:
self.state = 411
localctx._switch_label = self.switch_label()
localctx.labels.append(localctx._switch_label)
self.state = 414
self._errHandler.sync(self)
_la = self._input.LA(1)
if not (_la==32 or _la==33):
break
self.state = 417
self._errHandler.sync(self)
_la = self._input.LA(1)
while True:
self.state = 416
localctx._statement = self.statement()
localctx.statements.append(localctx._statement)
self.state = 419
self._errHandler.sync(self)
_la = self._input.LA(1)
if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & 1148417960802517024) != 0) or ((((_la - 93)) & ~0x3f) == 0 and ((1 << (_la - 93)) & 127) != 0)):
break
except RecognitionException as re:
localctx.exception = re
self._errHandler.reportError(self, re)
self._errHandler.recover(self, re)
finally:
self.exitRule()
return localctx
[docs]
class Switch_labelContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
self.const_expr = None # ExpressionContext
[docs]
def expression(self):
return self.getTypedRuleContext(CoreDSL2Parser.ExpressionContext,0)
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_switch_label
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterSwitch_label" ):
listener.enterSwitch_label(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitSwitch_label" ):
listener.exitSwitch_label(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitSwitch_label" ):
return visitor.visitSwitch_label(self)
else:
return visitor.visitChildren(self)
[docs]
def switch_label(self):
localctx = CoreDSL2Parser.Switch_labelContext(self, self._ctx, self.state)
self.enterRule(localctx, 26, self.RULE_switch_label)
try:
self.state = 427
self._errHandler.sync(self)
token = self._input.LA(1)
if token in [32]:
self.enterOuterAlt(localctx, 1)
self.state = 421
self.match(CoreDSL2Parser.T__31)
self.state = 422
localctx.const_expr = self.expression(0)
self.state = 423
self.match(CoreDSL2Parser.T__14)
pass
elif token in [33]:
self.enterOuterAlt(localctx, 2)
self.state = 425
self.match(CoreDSL2Parser.T__32)
self.state = 426
self.match(CoreDSL2Parser.T__14)
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
[docs]
class BlockContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
self._block_item = None # Block_itemContext
[docs]
self.items = list() # of Block_itemContexts
[docs]
def block_item(self, i:int=None):
if i is None:
return self.getTypedRuleContexts(CoreDSL2Parser.Block_itemContext)
else:
return self.getTypedRuleContext(CoreDSL2Parser.Block_itemContext,i)
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_block
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterBlock" ):
listener.enterBlock(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitBlock" ):
listener.exitBlock(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitBlock" ):
return visitor.visitBlock(self)
else:
return visitor.visitChildren(self)
[docs]
def block(self):
localctx = CoreDSL2Parser.BlockContext(self, self._ctx, self.state)
self.enterRule(localctx, 28, self.RULE_block)
self._la = 0 # Token type
try:
self.enterOuterAlt(localctx, 1)
self.state = 429
self.match(CoreDSL2Parser.T__4)
self.state = 433
self._errHandler.sync(self)
_la = self._input.LA(1)
while (((_la) & ~0x3f) == 0 and ((1 << _la) & 1149543585831976992) != 0) or ((((_la - 85)) & ~0x3f) == 0 and ((1 << (_la - 85)) & 32575) != 0):
self.state = 430
localctx._block_item = self.block_item()
localctx.items.append(localctx._block_item)
self.state = 435
self._errHandler.sync(self)
_la = self._input.LA(1)
self.state = 436
self.match(CoreDSL2Parser.T__5)
except RecognitionException as re:
localctx.exception = re
self._errHandler.reportError(self, re)
self._errHandler.recover(self, re)
finally:
self.exitRule()
return localctx
[docs]
class Block_itemContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
def statement(self):
return self.getTypedRuleContext(CoreDSL2Parser.StatementContext,0)
[docs]
def declaration(self):
return self.getTypedRuleContext(CoreDSL2Parser.DeclarationContext,0)
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_block_item
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterBlock_item" ):
listener.enterBlock_item(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitBlock_item" ):
listener.exitBlock_item(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitBlock_item" ):
return visitor.visitBlock_item(self)
else:
return visitor.visitChildren(self)
[docs]
def block_item(self):
localctx = CoreDSL2Parser.Block_itemContext(self, self._ctx, self.state)
self.enterRule(localctx, 30, self.RULE_block_item)
try:
self.state = 440
self._errHandler.sync(self)
token = self._input.LA(1)
if token in [5, 20, 22, 24, 25, 26, 27, 28, 29, 30, 31, 34, 35, 52, 53, 54, 55, 56, 57, 58, 59, 93, 94, 95, 96, 97, 98, 99]:
self.enterOuterAlt(localctx, 1)
self.state = 438
self.statement()
pass
elif token in [19, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 85, 86, 87, 88, 89, 90]:
self.enterOuterAlt(localctx, 2)
self.state = 439
self.declaration()
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
[docs]
class For_conditionContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
self.start_decl = None # DeclarationContext
[docs]
self.start_expr = None # ExpressionContext
[docs]
self.end_expr = None # ExpressionContext
[docs]
self._expression = None # ExpressionContext
[docs]
self.loop_exprs = list() # of ExpressionContexts
[docs]
def declaration(self):
return self.getTypedRuleContext(CoreDSL2Parser.DeclarationContext,0)
[docs]
def expression(self, i:int=None):
if i is None:
return self.getTypedRuleContexts(CoreDSL2Parser.ExpressionContext)
else:
return self.getTypedRuleContext(CoreDSL2Parser.ExpressionContext,i)
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_for_condition
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterFor_condition" ):
listener.enterFor_condition(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitFor_condition" ):
listener.exitFor_condition(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitFor_condition" ):
return visitor.visitFor_condition(self)
else:
return visitor.visitChildren(self)
[docs]
def for_condition(self):
localctx = CoreDSL2Parser.For_conditionContext(self, self._ctx, self.state)
self.enterRule(localctx, 32, self.RULE_for_condition)
self._la = 0 # Token type
try:
self.enterOuterAlt(localctx, 1)
self.state = 447
self._errHandler.sync(self)
token = self._input.LA(1)
if token in [19, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 85, 86, 87, 88, 89, 90]:
self.state = 442
localctx.start_decl = self.declaration()
pass
elif token in [10, 20, 34, 35, 52, 53, 54, 55, 56, 57, 58, 59, 93, 94, 95, 96, 97, 98, 99]:
self.state = 444
self._errHandler.sync(self)
_la = self._input.LA(1)
if (((_la) & ~0x3f) == 0 and ((1 << _la) & 1148417956520132608) != 0) or ((((_la - 93)) & ~0x3f) == 0 and ((1 << (_la - 93)) & 127) != 0):
self.state = 443
localctx.start_expr = self.expression(0)
self.state = 446
self.match(CoreDSL2Parser.T__9)
pass
else:
raise NoViableAltException(self)
self.state = 450
self._errHandler.sync(self)
_la = self._input.LA(1)
if (((_la) & ~0x3f) == 0 and ((1 << _la) & 1148417956520132608) != 0) or ((((_la - 93)) & ~0x3f) == 0 and ((1 << (_la - 93)) & 127) != 0):
self.state = 449
localctx.end_expr = self.expression(0)
self.state = 452
self.match(CoreDSL2Parser.T__9)
self.state = 461
self._errHandler.sync(self)
_la = self._input.LA(1)
if (((_la) & ~0x3f) == 0 and ((1 << _la) & 1148417956520132608) != 0) or ((((_la - 93)) & ~0x3f) == 0 and ((1 << (_la - 93)) & 127) != 0):
self.state = 453
localctx._expression = self.expression(0)
localctx.loop_exprs.append(localctx._expression)
self.state = 458
self._errHandler.sync(self)
_la = self._input.LA(1)
while _la==4:
self.state = 454
self.match(CoreDSL2Parser.T__3)
self.state = 455
localctx._expression = self.expression(0)
localctx.loop_exprs.append(localctx._expression)
self.state = 460
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
[docs]
class DeclarationContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
self._storage_class_specifier = None # Storage_class_specifierContext
[docs]
self.storage = list() # of Storage_class_specifierContexts
[docs]
self._type_qualifier = None # Type_qualifierContext
[docs]
self.qualifiers = list() # of Type_qualifierContexts
[docs]
self._attribute = None # AttributeContext
[docs]
self.attributes = list() # of AttributeContexts
[docs]
self.type_ = None # Type_specifierContext
[docs]
self._declarator = None # DeclaratorContext
[docs]
self.declarations = list() # of DeclaratorContexts
[docs]
def type_specifier(self):
return self.getTypedRuleContext(CoreDSL2Parser.Type_specifierContext,0)
[docs]
def storage_class_specifier(self, i:int=None):
if i is None:
return self.getTypedRuleContexts(CoreDSL2Parser.Storage_class_specifierContext)
else:
return self.getTypedRuleContext(CoreDSL2Parser.Storage_class_specifierContext,i)
[docs]
def type_qualifier(self, i:int=None):
if i is None:
return self.getTypedRuleContexts(CoreDSL2Parser.Type_qualifierContext)
else:
return self.getTypedRuleContext(CoreDSL2Parser.Type_qualifierContext,i)
[docs]
def attribute(self, i:int=None):
if i is None:
return self.getTypedRuleContexts(CoreDSL2Parser.AttributeContext)
else:
return self.getTypedRuleContext(CoreDSL2Parser.AttributeContext,i)
[docs]
def declarator(self, i:int=None):
if i is None:
return self.getTypedRuleContexts(CoreDSL2Parser.DeclaratorContext)
else:
return self.getTypedRuleContext(CoreDSL2Parser.DeclaratorContext,i)
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_declaration
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterDeclaration" ):
listener.enterDeclaration(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitDeclaration" ):
listener.exitDeclaration(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitDeclaration" ):
return visitor.visitDeclaration(self)
else:
return visitor.visitChildren(self)
[docs]
def declaration(self):
localctx = CoreDSL2Parser.DeclarationContext(self, self._ctx, self.state)
self.enterRule(localctx, 34, self.RULE_declaration)
self._la = 0 # Token type
try:
self.enterOuterAlt(localctx, 1)
self.state = 468
self._errHandler.sync(self)
_la = self._input.LA(1)
while _la==19 or _la==49 or ((((_la - 85)) & ~0x3f) == 0 and ((1 << (_la - 85)) & 15) != 0):
self.state = 466
self._errHandler.sync(self)
token = self._input.LA(1)
if token in [19, 87, 88]:
self.state = 463
localctx._storage_class_specifier = self.storage_class_specifier()
localctx.storage.append(localctx._storage_class_specifier)
pass
elif token in [85, 86]:
self.state = 464
localctx._type_qualifier = self.type_qualifier()
localctx.qualifiers.append(localctx._type_qualifier)
pass
elif token in [49]:
self.state = 465
localctx._attribute = self.attribute()
localctx.attributes.append(localctx._attribute)
pass
else:
raise NoViableAltException(self)
self.state = 470
self._errHandler.sync(self)
_la = self._input.LA(1)
self.state = 471
localctx.type_ = self.type_specifier()
self.state = 480
self._errHandler.sync(self)
_la = self._input.LA(1)
if _la==96:
self.state = 472
localctx._declarator = self.declarator()
localctx.declarations.append(localctx._declarator)
self.state = 477
self._errHandler.sync(self)
_la = self._input.LA(1)
while _la==4:
self.state = 473
self.match(CoreDSL2Parser.T__3)
self.state = 474
localctx._declarator = self.declarator()
localctx.declarations.append(localctx._declarator)
self.state = 479
self._errHandler.sync(self)
_la = self._input.LA(1)
self.state = 482
self.match(CoreDSL2Parser.T__9)
except RecognitionException as re:
localctx.exception = re
self._errHandler.reportError(self, re)
self._errHandler.recover(self, re)
finally:
self.exitRule()
return localctx
[docs]
class Type_specifierContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
self.type_ = None # Value_type_specifierContext
[docs]
self.ptr = None # Token
[docs]
def value_type_specifier(self):
return self.getTypedRuleContext(CoreDSL2Parser.Value_type_specifierContext,0)
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_type_specifier
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterType_specifier" ):
listener.enterType_specifier(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitType_specifier" ):
listener.exitType_specifier(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitType_specifier" ):
return visitor.visitType_specifier(self)
else:
return visitor.visitChildren(self)
[docs]
def type_specifier(self):
localctx = CoreDSL2Parser.Type_specifierContext(self, self._ctx, self.state)
self.enterRule(localctx, 36, self.RULE_type_specifier)
try:
self.enterOuterAlt(localctx, 1)
self.state = 484
localctx.type_ = self.value_type_specifier()
self.state = 487
self._errHandler.sync(self)
token = self._input.LA(1)
if token in [34]:
self.state = 485
localctx.ptr = self.match(CoreDSL2Parser.T__33)
pass
elif token in [35]:
self.state = 486
localctx.ptr = self.match(CoreDSL2Parser.T__34)
pass
elif token in [4, 10, 21, 96]:
pass
else:
pass
except RecognitionException as re:
localctx.exception = re
self._errHandler.reportError(self, re)
self._errHandler.recover(self, re)
finally:
self.exitRule()
return localctx
[docs]
class Value_type_specifierContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_value_type_specifier
[docs]
def copyFrom(self, ctx:ParserRuleContext):
super().copyFrom(ctx)
[docs]
class Composite_declarationContext(Value_type_specifierContext):
def __init__(self, parser, ctx:ParserRuleContext): # actually a CoreDSL2Parser.Value_type_specifierContext
super().__init__(parser)
[docs]
self.type_ = None # Struct_or_unionContext
[docs]
self.name = None # Token
[docs]
self._struct_declaration = None # Struct_declarationContext
[docs]
self.declarations = list() # of Struct_declarationContexts
self.copyFrom(ctx)
[docs]
def struct_or_union(self):
return self.getTypedRuleContext(CoreDSL2Parser.Struct_or_unionContext,0)
[docs]
def IDENTIFIER(self):
return self.getToken(CoreDSL2Parser.IDENTIFIER, 0)
[docs]
def struct_declaration(self, i:int=None):
if i is None:
return self.getTypedRuleContexts(CoreDSL2Parser.Struct_declarationContext)
else:
return self.getTypedRuleContext(CoreDSL2Parser.Struct_declarationContext,i)
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterComposite_declaration" ):
listener.enterComposite_declaration(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitComposite_declaration" ):
listener.exitComposite_declaration(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitComposite_declaration" ):
return visitor.visitComposite_declaration(self)
else:
return visitor.visitChildren(self)
[docs]
class Composite_referenceContext(Value_type_specifierContext):
def __init__(self, parser, ctx:ParserRuleContext): # actually a CoreDSL2Parser.Value_type_specifierContext
super().__init__(parser)
[docs]
self.type_ = None # Struct_or_unionContext
[docs]
self.name = None # Token
self.copyFrom(ctx)
[docs]
def struct_or_union(self):
return self.getTypedRuleContext(CoreDSL2Parser.Struct_or_unionContext,0)
[docs]
def IDENTIFIER(self):
return self.getToken(CoreDSL2Parser.IDENTIFIER, 0)
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterComposite_reference" ):
listener.enterComposite_reference(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitComposite_reference" ):
listener.exitComposite_reference(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitComposite_reference" ):
return visitor.visitComposite_reference(self)
else:
return visitor.visitChildren(self)
[docs]
class Enum_declarationContext(Value_type_specifierContext):
def __init__(self, parser, ctx:ParserRuleContext): # actually a CoreDSL2Parser.Value_type_specifierContext
super().__init__(parser)
[docs]
self.type_ = None # Token
[docs]
self.name = None # Token
self.copyFrom(ctx)
[docs]
def enumerator_list(self):
return self.getTypedRuleContext(CoreDSL2Parser.Enumerator_listContext,0)
[docs]
def IDENTIFIER(self):
return self.getToken(CoreDSL2Parser.IDENTIFIER, 0)
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterEnum_declaration" ):
listener.enterEnum_declaration(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitEnum_declaration" ):
listener.exitEnum_declaration(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitEnum_declaration" ):
return visitor.visitEnum_declaration(self)
else:
return visitor.visitChildren(self)
[docs]
class Void_typeContext(Value_type_specifierContext):
def __init__(self, parser, ctx:ParserRuleContext): # actually a CoreDSL2Parser.Value_type_specifierContext
super().__init__(parser)
[docs]
self.type_ = None # Token
self.copyFrom(ctx)
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterVoid_type" ):
listener.enterVoid_type(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitVoid_type" ):
listener.exitVoid_type(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitVoid_type" ):
return visitor.visitVoid_type(self)
else:
return visitor.visitChildren(self)
[docs]
class Enum_referenceContext(Value_type_specifierContext):
def __init__(self, parser, ctx:ParserRuleContext): # actually a CoreDSL2Parser.Value_type_specifierContext
super().__init__(parser)
[docs]
self.type_ = None # Token
[docs]
self.name = None # Token
self.copyFrom(ctx)
[docs]
def IDENTIFIER(self):
return self.getToken(CoreDSL2Parser.IDENTIFIER, 0)
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterEnum_reference" ):
listener.enterEnum_reference(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitEnum_reference" ):
listener.exitEnum_reference(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitEnum_reference" ):
return visitor.visitEnum_reference(self)
else:
return visitor.visitChildren(self)
[docs]
class Float_typeContext(Value_type_specifierContext):
def __init__(self, parser, ctx:ParserRuleContext): # actually a CoreDSL2Parser.Value_type_specifierContext
super().__init__(parser)
[docs]
self.shorthand = None # Float_shorthandContext
self.copyFrom(ctx)
[docs]
def float_shorthand(self):
return self.getTypedRuleContext(CoreDSL2Parser.Float_shorthandContext,0)
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterFloat_type" ):
listener.enterFloat_type(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitFloat_type" ):
listener.exitFloat_type(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitFloat_type" ):
return visitor.visitFloat_type(self)
else:
return visitor.visitChildren(self)
[docs]
class Bool_typeContext(Value_type_specifierContext):
def __init__(self, parser, ctx:ParserRuleContext): # actually a CoreDSL2Parser.Value_type_specifierContext
super().__init__(parser)
[docs]
self.type_ = None # Token
self.copyFrom(ctx)
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterBool_type" ):
listener.enterBool_type(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitBool_type" ):
listener.exitBool_type(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitBool_type" ):
return visitor.visitBool_type(self)
else:
return visitor.visitChildren(self)
[docs]
class Integer_typeContext(Value_type_specifierContext):
def __init__(self, parser, ctx:ParserRuleContext): # actually a CoreDSL2Parser.Value_type_specifierContext
super().__init__(parser)
[docs]
self.signed = None # Integer_signednessContext
[docs]
self.shorthand = None # Integer_shorthandContext
[docs]
self.size = None # PrimaryContext
self.copyFrom(ctx)
[docs]
def integer_signedness(self):
return self.getTypedRuleContext(CoreDSL2Parser.Integer_signednessContext,0)
[docs]
def integer_shorthand(self):
return self.getTypedRuleContext(CoreDSL2Parser.Integer_shorthandContext,0)
[docs]
def primary(self):
return self.getTypedRuleContext(CoreDSL2Parser.PrimaryContext,0)
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterInteger_type" ):
listener.enterInteger_type(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitInteger_type" ):
listener.exitInteger_type(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitInteger_type" ):
return visitor.visitInteger_type(self)
else:
return visitor.visitChildren(self)
[docs]
def value_type_specifier(self):
localctx = CoreDSL2Parser.Value_type_specifierContext(self, self._ctx, self.state)
self.enterRule(localctx, 38, self.RULE_value_type_specifier)
self._la = 0 # Token type
try:
self.state = 530
self._errHandler.sync(self)
la_ = self._interp.adaptivePredict(self._input,60,self._ctx)
if la_ == 1:
localctx = CoreDSL2Parser.Integer_typeContext(self, localctx)
self.enterOuterAlt(localctx, 1)
self.state = 489
localctx.signed = self.integer_signedness()
self.state = 495
self._errHandler.sync(self)
token = self._input.LA(1)
if token in [43, 44, 45, 46]:
self.state = 490
localctx.shorthand = self.integer_shorthand()
pass
elif token in [36]:
self.state = 491
self.match(CoreDSL2Parser.T__35)
self.state = 492
localctx.size = self.primary()
self.state = 493
self.match(CoreDSL2Parser.T__36)
pass
else:
raise NoViableAltException(self)
pass
elif la_ == 2:
localctx = CoreDSL2Parser.Integer_typeContext(self, localctx)
self.enterOuterAlt(localctx, 2)
self.state = 497
localctx.shorthand = self.integer_shorthand()
pass
elif la_ == 3:
localctx = CoreDSL2Parser.Float_typeContext(self, localctx)
self.enterOuterAlt(localctx, 3)
self.state = 498
localctx.shorthand = self.float_shorthand()
pass
elif la_ == 4:
localctx = CoreDSL2Parser.Bool_typeContext(self, localctx)
self.enterOuterAlt(localctx, 4)
self.state = 499
localctx.type_ = self.match(CoreDSL2Parser.T__37)
pass
elif la_ == 5:
localctx = CoreDSL2Parser.Void_typeContext(self, localctx)
self.enterOuterAlt(localctx, 5)
self.state = 500
localctx.type_ = self.match(CoreDSL2Parser.T__38)
pass
elif la_ == 6:
localctx = CoreDSL2Parser.Composite_declarationContext(self, localctx)
self.enterOuterAlt(localctx, 6)
self.state = 501
localctx.type_ = self.struct_or_union()
self.state = 503
self._errHandler.sync(self)
_la = self._input.LA(1)
if _la==96:
self.state = 502
localctx.name = self.match(CoreDSL2Parser.IDENTIFIER)
self.state = 505
self.match(CoreDSL2Parser.T__4)
self.state = 509
self._errHandler.sync(self)
_la = self._input.LA(1)
while ((((_la - 38)) & ~0x3f) == 0 and ((1 << (_la - 38)) & 7177611906123775) != 0):
self.state = 506
localctx._struct_declaration = self.struct_declaration()
localctx.declarations.append(localctx._struct_declaration)
self.state = 511
self._errHandler.sync(self)
_la = self._input.LA(1)
self.state = 512
self.match(CoreDSL2Parser.T__5)
pass
elif la_ == 7:
localctx = CoreDSL2Parser.Composite_referenceContext(self, localctx)
self.enterOuterAlt(localctx, 7)
self.state = 514
localctx.type_ = self.struct_or_union()
self.state = 515
localctx.name = self.match(CoreDSL2Parser.IDENTIFIER)
pass
elif la_ == 8:
localctx = CoreDSL2Parser.Enum_declarationContext(self, localctx)
self.enterOuterAlt(localctx, 8)
self.state = 517
localctx.type_ = self.match(CoreDSL2Parser.T__39)
self.state = 519
self._errHandler.sync(self)
_la = self._input.LA(1)
if _la==96:
self.state = 518
localctx.name = self.match(CoreDSL2Parser.IDENTIFIER)
self.state = 521
self.match(CoreDSL2Parser.T__4)
self.state = 522
self.enumerator_list()
self.state = 524
self._errHandler.sync(self)
_la = self._input.LA(1)
if _la==4:
self.state = 523
self.match(CoreDSL2Parser.T__3)
self.state = 526
self.match(CoreDSL2Parser.T__5)
pass
elif la_ == 9:
localctx = CoreDSL2Parser.Enum_referenceContext(self, localctx)
self.enterOuterAlt(localctx, 9)
self.state = 528
localctx.type_ = self.match(CoreDSL2Parser.T__39)
self.state = 529
localctx.name = self.match(CoreDSL2Parser.IDENTIFIER)
pass
except RecognitionException as re:
localctx.exception = re
self._errHandler.reportError(self, re)
self._errHandler.recover(self, re)
finally:
self.exitRule()
return localctx
[docs]
class Integer_signednessContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_integer_signedness
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterInteger_signedness" ):
listener.enterInteger_signedness(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitInteger_signedness" ):
listener.exitInteger_signedness(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitInteger_signedness" ):
return visitor.visitInteger_signedness(self)
else:
return visitor.visitChildren(self)
[docs]
def integer_signedness(self):
localctx = CoreDSL2Parser.Integer_signednessContext(self, self._ctx, self.state)
self.enterRule(localctx, 40, self.RULE_integer_signedness)
self._la = 0 # Token type
try:
self.enterOuterAlt(localctx, 1)
self.state = 532
_la = self._input.LA(1)
if not(_la==41 or _la==42):
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
[docs]
class Integer_shorthandContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_integer_shorthand
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterInteger_shorthand" ):
listener.enterInteger_shorthand(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitInteger_shorthand" ):
listener.exitInteger_shorthand(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitInteger_shorthand" ):
return visitor.visitInteger_shorthand(self)
else:
return visitor.visitChildren(self)
[docs]
def integer_shorthand(self):
localctx = CoreDSL2Parser.Integer_shorthandContext(self, self._ctx, self.state)
self.enterRule(localctx, 42, self.RULE_integer_shorthand)
self._la = 0 # Token type
try:
self.enterOuterAlt(localctx, 1)
self.state = 534
_la = self._input.LA(1)
if not((((_la) & ~0x3f) == 0 and ((1 << _la) & 131941395333120) != 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
[docs]
class Float_shorthandContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_float_shorthand
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterFloat_shorthand" ):
listener.enterFloat_shorthand(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitFloat_shorthand" ):
listener.exitFloat_shorthand(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitFloat_shorthand" ):
return visitor.visitFloat_shorthand(self)
else:
return visitor.visitChildren(self)
[docs]
def float_shorthand(self):
localctx = CoreDSL2Parser.Float_shorthandContext(self, self._ctx, self.state)
self.enterRule(localctx, 44, self.RULE_float_shorthand)
self._la = 0 # Token type
try:
self.enterOuterAlt(localctx, 1)
self.state = 536
_la = self._input.LA(1)
if not(_la==47 or _la==48):
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
[docs]
class AttributeContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
self.name = None # Token
[docs]
self._expression = None # ExpressionContext
[docs]
self.params = list() # of ExpressionContexts
[docs]
def IDENTIFIER(self):
return self.getToken(CoreDSL2Parser.IDENTIFIER, 0)
[docs]
def expression(self, i:int=None):
if i is None:
return self.getTypedRuleContexts(CoreDSL2Parser.ExpressionContext)
else:
return self.getTypedRuleContext(CoreDSL2Parser.ExpressionContext,i)
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_attribute
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterAttribute" ):
listener.enterAttribute(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitAttribute" ):
listener.exitAttribute(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitAttribute" ):
return visitor.visitAttribute(self)
else:
return visitor.visitChildren(self)
[docs]
def attribute(self):
localctx = CoreDSL2Parser.AttributeContext(self, self._ctx, self.state)
self.enterRule(localctx, 46, self.RULE_attribute)
self._la = 0 # Token type
try:
self.enterOuterAlt(localctx, 1)
self.state = 538
self.match(CoreDSL2Parser.T__48)
self.state = 539
localctx.name = self.match(CoreDSL2Parser.IDENTIFIER)
self.state = 553
self._errHandler.sync(self)
token = self._input.LA(1)
if token in [50]:
self.state = 540
self.match(CoreDSL2Parser.T__49)
self.state = 541
localctx._expression = self.expression(0)
localctx.params.append(localctx._expression)
pass
elif token in [20]:
self.state = 542
self.match(CoreDSL2Parser.T__19)
self.state = 543
localctx._expression = self.expression(0)
localctx.params.append(localctx._expression)
self.state = 548
self._errHandler.sync(self)
_la = self._input.LA(1)
while _la==4:
self.state = 544
self.match(CoreDSL2Parser.T__3)
self.state = 545
localctx._expression = self.expression(0)
localctx.params.append(localctx._expression)
self.state = 550
self._errHandler.sync(self)
_la = self._input.LA(1)
self.state = 551
self.match(CoreDSL2Parser.T__20)
pass
elif token in [51]:
pass
else:
pass
self.state = 555
self.match(CoreDSL2Parser.T__50)
except RecognitionException as re:
localctx.exception = re
self._errHandler.reportError(self, re)
self._errHandler.recover(self, re)
finally:
self.exitRule()
return localctx
[docs]
class Bit_size_specifierContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
self._primary = None # PrimaryContext
[docs]
self.size = list() # of PrimaryContexts
[docs]
def primary(self, i:int=None):
if i is None:
return self.getTypedRuleContexts(CoreDSL2Parser.PrimaryContext)
else:
return self.getTypedRuleContext(CoreDSL2Parser.PrimaryContext,i)
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_bit_size_specifier
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterBit_size_specifier" ):
listener.enterBit_size_specifier(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitBit_size_specifier" ):
listener.exitBit_size_specifier(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitBit_size_specifier" ):
return visitor.visitBit_size_specifier(self)
else:
return visitor.visitChildren(self)
[docs]
def bit_size_specifier(self):
localctx = CoreDSL2Parser.Bit_size_specifierContext(self, self._ctx, self.state)
self.enterRule(localctx, 48, self.RULE_bit_size_specifier)
self._la = 0 # Token type
try:
self.enterOuterAlt(localctx, 1)
self.state = 557
self.match(CoreDSL2Parser.T__35)
self.state = 558
localctx._primary = self.primary()
localctx.size.append(localctx._primary)
self.state = 566
self._errHandler.sync(self)
_la = self._input.LA(1)
if _la==4:
self.state = 559
self.match(CoreDSL2Parser.T__3)
self.state = 560
localctx._primary = self.primary()
localctx.size.append(localctx._primary)
self.state = 561
self.match(CoreDSL2Parser.T__3)
self.state = 562
localctx._primary = self.primary()
localctx.size.append(localctx._primary)
self.state = 563
self.match(CoreDSL2Parser.T__3)
self.state = 564
localctx._primary = self.primary()
localctx.size.append(localctx._primary)
self.state = 568
self.match(CoreDSL2Parser.T__36)
except RecognitionException as re:
localctx.exception = re
self._errHandler.reportError(self, re)
self._errHandler.recover(self, re)
finally:
self.exitRule()
return localctx
[docs]
class Enumerator_listContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
self._enumerator = None # EnumeratorContext
[docs]
self.enumerators = list() # of EnumeratorContexts
[docs]
def enumerator(self, i:int=None):
if i is None:
return self.getTypedRuleContexts(CoreDSL2Parser.EnumeratorContext)
else:
return self.getTypedRuleContext(CoreDSL2Parser.EnumeratorContext,i)
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_enumerator_list
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterEnumerator_list" ):
listener.enterEnumerator_list(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitEnumerator_list" ):
listener.exitEnumerator_list(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitEnumerator_list" ):
return visitor.visitEnumerator_list(self)
else:
return visitor.visitChildren(self)
[docs]
def enumerator_list(self):
localctx = CoreDSL2Parser.Enumerator_listContext(self, self._ctx, self.state)
self.enterRule(localctx, 50, self.RULE_enumerator_list)
try:
self.enterOuterAlt(localctx, 1)
self.state = 570
localctx._enumerator = self.enumerator()
localctx.enumerators.append(localctx._enumerator)
self.state = 575
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 = 571
self.match(CoreDSL2Parser.T__3)
self.state = 572
localctx._enumerator = self.enumerator()
localctx.enumerators.append(localctx._enumerator)
self.state = 577
self._errHandler.sync(self)
_alt = self._interp.adaptivePredict(self._input,64,self._ctx)
except RecognitionException as re:
localctx.exception = re
self._errHandler.reportError(self, re)
self._errHandler.recover(self, re)
finally:
self.exitRule()
return localctx
[docs]
class EnumeratorContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
self.name = None # Token
[docs]
def IDENTIFIER(self):
return self.getToken(CoreDSL2Parser.IDENTIFIER, 0)
[docs]
def expression(self):
return self.getTypedRuleContext(CoreDSL2Parser.ExpressionContext,0)
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_enumerator
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterEnumerator" ):
listener.enterEnumerator(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitEnumerator" ):
listener.exitEnumerator(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitEnumerator" ):
return visitor.visitEnumerator(self)
else:
return visitor.visitChildren(self)
[docs]
def enumerator(self):
localctx = CoreDSL2Parser.EnumeratorContext(self, self._ctx, self.state)
self.enterRule(localctx, 52, self.RULE_enumerator)
try:
self.state = 582
self._errHandler.sync(self)
la_ = self._interp.adaptivePredict(self._input,65,self._ctx)
if la_ == 1:
self.enterOuterAlt(localctx, 1)
self.state = 578
localctx.name = self.match(CoreDSL2Parser.IDENTIFIER)
pass
elif la_ == 2:
self.enterOuterAlt(localctx, 2)
self.state = 579
localctx.name = self.match(CoreDSL2Parser.IDENTIFIER)
self.state = 580
self.match(CoreDSL2Parser.T__49)
self.state = 581
self.expression(0)
pass
except RecognitionException as re:
localctx.exception = re
self._errHandler.reportError(self, re)
self._errHandler.recover(self, re)
finally:
self.exitRule()
return localctx
[docs]
class Struct_declarationContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
self.specifier = None # Struct_declaration_specifierContext
[docs]
self._declarator = None # DeclaratorContext
[docs]
self.declarators = list() # of DeclaratorContexts
[docs]
def struct_declaration_specifier(self):
return self.getTypedRuleContext(CoreDSL2Parser.Struct_declaration_specifierContext,0)
[docs]
def declarator(self, i:int=None):
if i is None:
return self.getTypedRuleContexts(CoreDSL2Parser.DeclaratorContext)
else:
return self.getTypedRuleContext(CoreDSL2Parser.DeclaratorContext,i)
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_struct_declaration
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterStruct_declaration" ):
listener.enterStruct_declaration(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitStruct_declaration" ):
listener.exitStruct_declaration(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitStruct_declaration" ):
return visitor.visitStruct_declaration(self)
else:
return visitor.visitChildren(self)
[docs]
def struct_declaration(self):
localctx = CoreDSL2Parser.Struct_declarationContext(self, self._ctx, self.state)
self.enterRule(localctx, 54, self.RULE_struct_declaration)
self._la = 0 # Token type
try:
self.enterOuterAlt(localctx, 1)
self.state = 584
localctx.specifier = self.struct_declaration_specifier()
self.state = 585
localctx._declarator = self.declarator()
localctx.declarators.append(localctx._declarator)
self.state = 590
self._errHandler.sync(self)
_la = self._input.LA(1)
while _la==4:
self.state = 586
self.match(CoreDSL2Parser.T__3)
self.state = 587
localctx._declarator = self.declarator()
localctx.declarators.append(localctx._declarator)
self.state = 592
self._errHandler.sync(self)
_la = self._input.LA(1)
self.state = 593
self.match(CoreDSL2Parser.T__9)
except RecognitionException as re:
localctx.exception = re
self._errHandler.reportError(self, re)
self._errHandler.recover(self, re)
finally:
self.exitRule()
return localctx
[docs]
class Struct_declaration_specifierContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
self.type_ = None # Type_specifierContext
[docs]
self._type_qualifier = None # Type_qualifierContext
[docs]
self.qualifiers = list() # of Type_qualifierContexts
[docs]
def type_specifier(self):
return self.getTypedRuleContext(CoreDSL2Parser.Type_specifierContext,0)
[docs]
def type_qualifier(self):
return self.getTypedRuleContext(CoreDSL2Parser.Type_qualifierContext,0)
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_struct_declaration_specifier
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterStruct_declaration_specifier" ):
listener.enterStruct_declaration_specifier(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitStruct_declaration_specifier" ):
listener.exitStruct_declaration_specifier(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitStruct_declaration_specifier" ):
return visitor.visitStruct_declaration_specifier(self)
else:
return visitor.visitChildren(self)
[docs]
def struct_declaration_specifier(self):
localctx = CoreDSL2Parser.Struct_declaration_specifierContext(self, self._ctx, self.state)
self.enterRule(localctx, 56, self.RULE_struct_declaration_specifier)
try:
self.state = 597
self._errHandler.sync(self)
token = self._input.LA(1)
if token in [38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 89, 90]:
self.enterOuterAlt(localctx, 1)
self.state = 595
localctx.type_ = self.type_specifier()
pass
elif token in [85, 86]:
self.enterOuterAlt(localctx, 2)
self.state = 596
localctx._type_qualifier = self.type_qualifier()
localctx.qualifiers.append(localctx._type_qualifier)
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
[docs]
class DeclaratorContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
self.name = None # Token
[docs]
self._expression = None # ExpressionContext
[docs]
self.size = list() # of ExpressionContexts
[docs]
self._attribute = None # AttributeContext
[docs]
self.attributes = list() # of AttributeContexts
[docs]
self.init = None # InitializerContext
[docs]
def IDENTIFIER(self):
return self.getToken(CoreDSL2Parser.IDENTIFIER, 0)
[docs]
def LEFT_BR(self, i:int=None):
if i is None:
return self.getTokens(CoreDSL2Parser.LEFT_BR)
else:
return self.getToken(CoreDSL2Parser.LEFT_BR, i)
[docs]
def RIGHT_BR(self, i:int=None):
if i is None:
return self.getTokens(CoreDSL2Parser.RIGHT_BR)
else:
return self.getToken(CoreDSL2Parser.RIGHT_BR, i)
[docs]
def expression(self, i:int=None):
if i is None:
return self.getTypedRuleContexts(CoreDSL2Parser.ExpressionContext)
else:
return self.getTypedRuleContext(CoreDSL2Parser.ExpressionContext,i)
[docs]
def attribute(self, i:int=None):
if i is None:
return self.getTypedRuleContexts(CoreDSL2Parser.AttributeContext)
else:
return self.getTypedRuleContext(CoreDSL2Parser.AttributeContext,i)
[docs]
def initializer(self):
return self.getTypedRuleContext(CoreDSL2Parser.InitializerContext,0)
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_declarator
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterDeclarator" ):
listener.enterDeclarator(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitDeclarator" ):
listener.exitDeclarator(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitDeclarator" ):
return visitor.visitDeclarator(self)
else:
return visitor.visitChildren(self)
[docs]
def declarator(self):
localctx = CoreDSL2Parser.DeclaratorContext(self, self._ctx, self.state)
self.enterRule(localctx, 58, self.RULE_declarator)
self._la = 0 # Token type
try:
self.enterOuterAlt(localctx, 1)
self.state = 599
localctx.name = self.match(CoreDSL2Parser.IDENTIFIER)
self.state = 606
self._errHandler.sync(self)
_la = self._input.LA(1)
while _la==91:
self.state = 600
self.match(CoreDSL2Parser.LEFT_BR)
self.state = 601
localctx._expression = self.expression(0)
localctx.size.append(localctx._expression)
self.state = 602
self.match(CoreDSL2Parser.RIGHT_BR)
self.state = 608
self._errHandler.sync(self)
_la = self._input.LA(1)
self.state = 612
self._errHandler.sync(self)
_la = self._input.LA(1)
while _la==49:
self.state = 609
localctx._attribute = self.attribute()
localctx.attributes.append(localctx._attribute)
self.state = 614
self._errHandler.sync(self)
_la = self._input.LA(1)
self.state = 617
self._errHandler.sync(self)
_la = self._input.LA(1)
if _la==50:
self.state = 615
self.match(CoreDSL2Parser.T__49)
self.state = 616
localctx.init = self.initializer()
except RecognitionException as re:
localctx.exception = re
self._errHandler.reportError(self, re)
self._errHandler.recover(self, re)
finally:
self.exitRule()
return localctx
[docs]
class InitializerContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
self.expr = None # ExpressionContext
[docs]
def expression(self):
return self.getTypedRuleContext(CoreDSL2Parser.ExpressionContext,0)
[docs]
def initializerList(self):
return self.getTypedRuleContext(CoreDSL2Parser.InitializerListContext,0)
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_initializer
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterInitializer" ):
listener.enterInitializer(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitInitializer" ):
listener.exitInitializer(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitInitializer" ):
return visitor.visitInitializer(self)
else:
return visitor.visitChildren(self)
[docs]
def initializer(self):
localctx = CoreDSL2Parser.InitializerContext(self, self._ctx, self.state)
self.enterRule(localctx, 60, self.RULE_initializer)
self._la = 0 # Token type
try:
self.state = 627
self._errHandler.sync(self)
token = self._input.LA(1)
if token in [20, 34, 35, 52, 53, 54, 55, 56, 57, 58, 59, 93, 94, 95, 96, 97, 98, 99]:
self.enterOuterAlt(localctx, 1)
self.state = 619
localctx.expr = self.expression(0)
pass
elif token in [5]:
self.enterOuterAlt(localctx, 2)
self.state = 620
self.match(CoreDSL2Parser.T__4)
self.state = 621
self.initializerList()
self.state = 623
self._errHandler.sync(self)
_la = self._input.LA(1)
if _la==4:
self.state = 622
self.match(CoreDSL2Parser.T__3)
self.state = 625
self.match(CoreDSL2Parser.T__5)
pass
else:
raise NoViableAltException(self)
except RecognitionException as re:
localctx.exception = re
self._errHandler.reportError(self, re)
self._errHandler.recover(self, re)
finally:
self.exitRule()
return localctx
[docs]
class InitializerListContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
def designated_initializer(self, i:int=None):
if i is None:
return self.getTypedRuleContexts(CoreDSL2Parser.Designated_initializerContext)
else:
return self.getTypedRuleContext(CoreDSL2Parser.Designated_initializerContext,i)
[docs]
def initializer(self, i:int=None):
if i is None:
return self.getTypedRuleContexts(CoreDSL2Parser.InitializerContext)
else:
return self.getTypedRuleContext(CoreDSL2Parser.InitializerContext,i)
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_initializerList
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterInitializerList" ):
listener.enterInitializerList(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitInitializerList" ):
listener.exitInitializerList(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitInitializerList" ):
return visitor.visitInitializerList(self)
else:
return visitor.visitChildren(self)
[docs]
def initializerList(self):
localctx = CoreDSL2Parser.InitializerListContext(self, self._ctx, self.state)
self.enterRule(localctx, 62, self.RULE_initializerList)
try:
self.enterOuterAlt(localctx, 1)
self.state = 631
self._errHandler.sync(self)
la_ = self._interp.adaptivePredict(self._input,73,self._ctx)
if la_ == 1:
self.state = 629
self.designated_initializer()
pass
elif la_ == 2:
self.state = 630
self.initializer()
pass
self.state = 640
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 = 633
self.match(CoreDSL2Parser.T__3)
self.state = 636
self._errHandler.sync(self)
la_ = self._interp.adaptivePredict(self._input,74,self._ctx)
if la_ == 1:
self.state = 634
self.designated_initializer()
pass
elif la_ == 2:
self.state = 635
self.initializer()
pass
self.state = 642
self._errHandler.sync(self)
_alt = self._interp.adaptivePredict(self._input,75,self._ctx)
except RecognitionException as re:
localctx.exception = re
self._errHandler.reportError(self, re)
self._errHandler.recover(self, re)
finally:
self.exitRule()
return localctx
[docs]
class Designated_initializerContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
self._designator = None # DesignatorContext
[docs]
self.designators = list() # of DesignatorContexts
[docs]
self.init = None # InitializerContext
[docs]
def initializer(self):
return self.getTypedRuleContext(CoreDSL2Parser.InitializerContext,0)
[docs]
def designator(self, i:int=None):
if i is None:
return self.getTypedRuleContexts(CoreDSL2Parser.DesignatorContext)
else:
return self.getTypedRuleContext(CoreDSL2Parser.DesignatorContext,i)
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_designated_initializer
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterDesignated_initializer" ):
listener.enterDesignated_initializer(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitDesignated_initializer" ):
listener.exitDesignated_initializer(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitDesignated_initializer" ):
return visitor.visitDesignated_initializer(self)
else:
return visitor.visitChildren(self)
[docs]
def designated_initializer(self):
localctx = CoreDSL2Parser.Designated_initializerContext(self, self._ctx, self.state)
self.enterRule(localctx, 64, self.RULE_designated_initializer)
self._la = 0 # Token type
try:
self.enterOuterAlt(localctx, 1)
self.state = 644
self._errHandler.sync(self)
_la = self._input.LA(1)
while True:
self.state = 643
localctx._designator = self.designator()
localctx.designators.append(localctx._designator)
self.state = 646
self._errHandler.sync(self)
_la = self._input.LA(1)
if not (_la==52 or _la==91):
break
self.state = 648
self.match(CoreDSL2Parser.T__49)
self.state = 649
localctx.init = self.initializer()
except RecognitionException as re:
localctx.exception = re
self._errHandler.reportError(self, re)
self._errHandler.recover(self, re)
finally:
self.exitRule()
return localctx
[docs]
class DesignatorContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
self.idx = None # ExpressionContext
[docs]
self.prop = None # Token
[docs]
def LEFT_BR(self):
return self.getToken(CoreDSL2Parser.LEFT_BR, 0)
[docs]
def RIGHT_BR(self):
return self.getToken(CoreDSL2Parser.RIGHT_BR, 0)
[docs]
def expression(self):
return self.getTypedRuleContext(CoreDSL2Parser.ExpressionContext,0)
[docs]
def IDENTIFIER(self):
return self.getToken(CoreDSL2Parser.IDENTIFIER, 0)
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_designator
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterDesignator" ):
listener.enterDesignator(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitDesignator" ):
listener.exitDesignator(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitDesignator" ):
return visitor.visitDesignator(self)
else:
return visitor.visitChildren(self)
[docs]
def designator(self):
localctx = CoreDSL2Parser.DesignatorContext(self, self._ctx, self.state)
self.enterRule(localctx, 66, self.RULE_designator)
try:
self.state = 657
self._errHandler.sync(self)
token = self._input.LA(1)
if token in [91]:
self.enterOuterAlt(localctx, 1)
self.state = 651
self.match(CoreDSL2Parser.LEFT_BR)
self.state = 652
localctx.idx = self.expression(0)
self.state = 653
self.match(CoreDSL2Parser.RIGHT_BR)
pass
elif token in [52]:
self.enterOuterAlt(localctx, 2)
self.state = 655
self.match(CoreDSL2Parser.T__51)
self.state = 656
localctx.prop = self.match(CoreDSL2Parser.IDENTIFIER)
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
[docs]
class ExpressionContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_expression
[docs]
def copyFrom(self, ctx:ParserRuleContext):
super().copyFrom(ctx)
[docs]
class Cast_expressionContext(ExpressionContext):
def __init__(self, parser, ctx:ParserRuleContext): # actually a CoreDSL2Parser.ExpressionContext
super().__init__(parser)
[docs]
self.type_ = None # Type_specifierContext
[docs]
self.sign = None # Integer_signednessContext
[docs]
self.right = None # ExpressionContext
self.copyFrom(ctx)
[docs]
def expression(self):
return self.getTypedRuleContext(CoreDSL2Parser.ExpressionContext,0)
[docs]
def type_specifier(self):
return self.getTypedRuleContext(CoreDSL2Parser.Type_specifierContext,0)
[docs]
def integer_signedness(self):
return self.getTypedRuleContext(CoreDSL2Parser.Integer_signednessContext,0)
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterCast_expression" ):
listener.enterCast_expression(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitCast_expression" ):
listener.exitCast_expression(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitCast_expression" ):
return visitor.visitCast_expression(self)
else:
return visitor.visitChildren(self)
[docs]
class Binary_expressionContext(ExpressionContext):
def __init__(self, parser, ctx:ParserRuleContext): # actually a CoreDSL2Parser.ExpressionContext
super().__init__(parser)
[docs]
self.left = None # ExpressionContext
[docs]
self.bop = None # Token
[docs]
self.right = None # ExpressionContext
self.copyFrom(ctx)
[docs]
def expression(self, i:int=None):
if i is None:
return self.getTypedRuleContexts(CoreDSL2Parser.ExpressionContext)
else:
return self.getTypedRuleContext(CoreDSL2Parser.ExpressionContext,i)
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterBinary_expression" ):
listener.enterBinary_expression(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitBinary_expression" ):
listener.exitBinary_expression(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitBinary_expression" ):
return visitor.visitBinary_expression(self)
else:
return visitor.visitChildren(self)
[docs]
class Preinc_expressionContext(ExpressionContext):
def __init__(self, parser, ctx:ParserRuleContext): # actually a CoreDSL2Parser.ExpressionContext
super().__init__(parser)
[docs]
self.op = None # Token
[docs]
self.right = None # ExpressionContext
self.copyFrom(ctx)
[docs]
def expression(self):
return self.getTypedRuleContext(CoreDSL2Parser.ExpressionContext,0)
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterPreinc_expression" ):
listener.enterPreinc_expression(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitPreinc_expression" ):
listener.exitPreinc_expression(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitPreinc_expression" ):
return visitor.visitPreinc_expression(self)
else:
return visitor.visitChildren(self)
[docs]
class Conditional_expressionContext(ExpressionContext):
def __init__(self, parser, ctx:ParserRuleContext): # actually a CoreDSL2Parser.ExpressionContext
super().__init__(parser)
[docs]
self.cond = None # ExpressionContext
[docs]
self.bop = None # Token
[docs]
self.then_expr = None # ExpressionContext
[docs]
self.else_expr = None # ExpressionContext
self.copyFrom(ctx)
[docs]
def expression(self, i:int=None):
if i is None:
return self.getTypedRuleContexts(CoreDSL2Parser.ExpressionContext)
else:
return self.getTypedRuleContext(CoreDSL2Parser.ExpressionContext,i)
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterConditional_expression" ):
listener.enterConditional_expression(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitConditional_expression" ):
listener.exitConditional_expression(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitConditional_expression" ):
return visitor.visitConditional_expression(self)
else:
return visitor.visitChildren(self)
[docs]
class Deref_expressionContext(ExpressionContext):
def __init__(self, parser, ctx:ParserRuleContext): # actually a CoreDSL2Parser.ExpressionContext
super().__init__(parser)
[docs]
self.bop = None # Token
[docs]
self.ref = None # Token
self.copyFrom(ctx)
[docs]
def IDENTIFIER(self):
return self.getToken(CoreDSL2Parser.IDENTIFIER, 0)
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterDeref_expression" ):
listener.enterDeref_expression(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitDeref_expression" ):
listener.exitDeref_expression(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitDeref_expression" ):
return visitor.visitDeref_expression(self)
else:
return visitor.visitChildren(self)
[docs]
class Prefix_expressionContext(ExpressionContext):
def __init__(self, parser, ctx:ParserRuleContext): # actually a CoreDSL2Parser.ExpressionContext
super().__init__(parser)
[docs]
self.prefix = None # Token
[docs]
self.right = None # ExpressionContext
self.copyFrom(ctx)
[docs]
def expression(self):
return self.getTypedRuleContext(CoreDSL2Parser.ExpressionContext,0)
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterPrefix_expression" ):
listener.enterPrefix_expression(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitPrefix_expression" ):
listener.exitPrefix_expression(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitPrefix_expression" ):
return visitor.visitPrefix_expression(self)
else:
return visitor.visitChildren(self)
[docs]
class Postinc_expressionContext(ExpressionContext):
def __init__(self, parser, ctx:ParserRuleContext): # actually a CoreDSL2Parser.ExpressionContext
super().__init__(parser)
[docs]
self.left = None # ExpressionContext
[docs]
self.op = None # Token
self.copyFrom(ctx)
[docs]
def expression(self):
return self.getTypedRuleContext(CoreDSL2Parser.ExpressionContext,0)
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterPostinc_expression" ):
listener.enterPostinc_expression(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitPostinc_expression" ):
listener.exitPostinc_expression(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitPostinc_expression" ):
return visitor.visitPostinc_expression(self)
else:
return visitor.visitChildren(self)
[docs]
class Concat_expressionContext(ExpressionContext):
def __init__(self, parser, ctx:ParserRuleContext): # actually a CoreDSL2Parser.ExpressionContext
super().__init__(parser)
[docs]
self.left = None # ExpressionContext
[docs]
self.bop = None # Token
[docs]
self.right = None # ExpressionContext
self.copyFrom(ctx)
[docs]
def expression(self, i:int=None):
if i is None:
return self.getTypedRuleContexts(CoreDSL2Parser.ExpressionContext)
else:
return self.getTypedRuleContext(CoreDSL2Parser.ExpressionContext,i)
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterConcat_expression" ):
listener.enterConcat_expression(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitConcat_expression" ):
listener.exitConcat_expression(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitConcat_expression" ):
return visitor.visitConcat_expression(self)
else:
return visitor.visitChildren(self)
[docs]
class Assignment_expressionContext(ExpressionContext):
def __init__(self, parser, ctx:ParserRuleContext): # actually a CoreDSL2Parser.ExpressionContext
super().__init__(parser)
[docs]
self.left = None # ExpressionContext
[docs]
self.bop = None # Token
[docs]
self.right = None # ExpressionContext
self.copyFrom(ctx)
[docs]
def expression(self, i:int=None):
if i is None:
return self.getTypedRuleContexts(CoreDSL2Parser.ExpressionContext)
else:
return self.getTypedRuleContext(CoreDSL2Parser.ExpressionContext,i)
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterAssignment_expression" ):
listener.enterAssignment_expression(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitAssignment_expression" ):
listener.exitAssignment_expression(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitAssignment_expression" ):
return visitor.visitAssignment_expression(self)
else:
return visitor.visitChildren(self)
[docs]
class Method_callContext(ExpressionContext):
def __init__(self, parser, ctx:ParserRuleContext): # actually a CoreDSL2Parser.ExpressionContext
super().__init__(parser)
[docs]
self.ref = None # Token
[docs]
self._expression = None # ExpressionContext
[docs]
self.args = list() # of ExpressionContexts
self.copyFrom(ctx)
[docs]
def IDENTIFIER(self):
return self.getToken(CoreDSL2Parser.IDENTIFIER, 0)
[docs]
def expression(self, i:int=None):
if i is None:
return self.getTypedRuleContexts(CoreDSL2Parser.ExpressionContext)
else:
return self.getTypedRuleContext(CoreDSL2Parser.ExpressionContext,i)
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterMethod_call" ):
listener.enterMethod_call(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitMethod_call" ):
listener.exitMethod_call(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitMethod_call" ):
return visitor.visitMethod_call(self)
else:
return visitor.visitChildren(self)
[docs]
class Primary_expressionContext(ExpressionContext):
def __init__(self, parser, ctx:ParserRuleContext): # actually a CoreDSL2Parser.ExpressionContext
super().__init__(parser)
self.copyFrom(ctx)
[docs]
def primary(self):
return self.getTypedRuleContext(CoreDSL2Parser.PrimaryContext,0)
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterPrimary_expression" ):
listener.enterPrimary_expression(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitPrimary_expression" ):
listener.exitPrimary_expression(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitPrimary_expression" ):
return visitor.visitPrimary_expression(self)
else:
return visitor.visitChildren(self)
[docs]
class Slice_expressionContext(ExpressionContext):
def __init__(self, parser, ctx:ParserRuleContext): # actually a CoreDSL2Parser.ExpressionContext
super().__init__(parser)
[docs]
self.expr = None # ExpressionContext
[docs]
self.bop = None # Token
[docs]
self.left = None # ExpressionContext
[docs]
self.right = None # ExpressionContext
self.copyFrom(ctx)
[docs]
def RIGHT_BR(self):
return self.getToken(CoreDSL2Parser.RIGHT_BR, 0)
[docs]
def expression(self, i:int=None):
if i is None:
return self.getTypedRuleContexts(CoreDSL2Parser.ExpressionContext)
else:
return self.getTypedRuleContext(CoreDSL2Parser.ExpressionContext,i)
[docs]
def LEFT_BR(self):
return self.getToken(CoreDSL2Parser.LEFT_BR, 0)
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterSlice_expression" ):
listener.enterSlice_expression(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitSlice_expression" ):
listener.exitSlice_expression(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitSlice_expression" ):
return visitor.visitSlice_expression(self)
else:
return visitor.visitChildren(self)
[docs]
def expression(self, _p:int=0):
_parentctx = self._ctx
_parentState = self.state
localctx = CoreDSL2Parser.ExpressionContext(self, self._ctx, _parentState)
_prevctx = localctx
_startState = 68
self.enterRecursionRule(localctx, 68, self.RULE_expression, _p)
self._la = 0 # Token type
try:
self.enterOuterAlt(localctx, 1)
self.state = 690
self._errHandler.sync(self)
la_ = self._interp.adaptivePredict(self._input,81,self._ctx)
if la_ == 1:
localctx = CoreDSL2Parser.Primary_expressionContext(self, localctx)
self._ctx = localctx
_prevctx = localctx
self.state = 660
self.primary()
pass
elif la_ == 2:
localctx = CoreDSL2Parser.Deref_expressionContext(self, localctx)
self._ctx = localctx
_prevctx = localctx
self.state = 661
localctx.bop = self._input.LT(1)
_la = self._input.LA(1)
if not(_la==52 or _la==53):
localctx.bop = self._errHandler.recoverInline(self)
else:
self._errHandler.reportMatch(self)
self.consume()
self.state = 662
localctx.ref = self.match(CoreDSL2Parser.IDENTIFIER)
pass
elif la_ == 3:
localctx = CoreDSL2Parser.Method_callContext(self, localctx)
self._ctx = localctx
_prevctx = localctx
self.state = 663
localctx.ref = self.match(CoreDSL2Parser.IDENTIFIER)
self.state = 664
self.match(CoreDSL2Parser.T__19)
self.state = 673
self._errHandler.sync(self)
_la = self._input.LA(1)
if (((_la) & ~0x3f) == 0 and ((1 << _la) & 1148417956520132608) != 0) or ((((_la - 93)) & ~0x3f) == 0 and ((1 << (_la - 93)) & 127) != 0):
self.state = 665
localctx._expression = self.expression(0)
localctx.args.append(localctx._expression)
self.state = 670
self._errHandler.sync(self)
_la = self._input.LA(1)
while _la==4:
self.state = 666
self.match(CoreDSL2Parser.T__3)
self.state = 667
localctx._expression = self.expression(0)
localctx.args.append(localctx._expression)
self.state = 672
self._errHandler.sync(self)
_la = self._input.LA(1)
self.state = 675
self.match(CoreDSL2Parser.T__20)
pass
elif la_ == 4:
localctx = CoreDSL2Parser.Preinc_expressionContext(self, localctx)
self._ctx = localctx
_prevctx = localctx
self.state = 676
localctx.op = self._input.LT(1)
_la = self._input.LA(1)
if not(_la==54 or _la==55):
localctx.op = self._errHandler.recoverInline(self)
else:
self._errHandler.reportMatch(self)
self.consume()
self.state = 677
localctx.right = self.expression(17)
pass
elif la_ == 5:
localctx = CoreDSL2Parser.Prefix_expressionContext(self, localctx)
self._ctx = localctx
_prevctx = localctx
self.state = 678
localctx.prefix = self._input.LT(1)
_la = self._input.LA(1)
if not((((_la) & ~0x3f) == 0 and ((1 << _la) & 216172833653391360) != 0)):
localctx.prefix = self._errHandler.recoverInline(self)
else:
self._errHandler.reportMatch(self)
self.consume()
self.state = 679
localctx.right = self.expression(16)
pass
elif la_ == 6:
localctx = CoreDSL2Parser.Prefix_expressionContext(self, localctx)
self._ctx = localctx
_prevctx = localctx
self.state = 680
localctx.prefix = self._input.LT(1)
_la = self._input.LA(1)
if not(_la==58 or _la==59):
localctx.prefix = self._errHandler.recoverInline(self)
else:
self._errHandler.reportMatch(self)
self.consume()
self.state = 681
localctx.right = self.expression(15)
pass
elif la_ == 7:
localctx = CoreDSL2Parser.Cast_expressionContext(self, localctx)
self._ctx = localctx
_prevctx = localctx
self.state = 682
self.match(CoreDSL2Parser.T__19)
self.state = 685
self._errHandler.sync(self)
la_ = self._interp.adaptivePredict(self._input,80,self._ctx)
if la_ == 1:
self.state = 683
localctx.type_ = self.type_specifier()
pass
elif la_ == 2:
self.state = 684
localctx.sign = self.integer_signedness()
pass
self.state = 687
self.match(CoreDSL2Parser.T__20)
self.state = 688
localctx.right = self.expression(14)
pass
self._ctx.stop = self._input.LT(-1)
self.state = 747
self._errHandler.sync(self)
_alt = self._interp.adaptivePredict(self._input,84,self._ctx)
while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
if _alt==1:
if self._parseListeners is not None:
self.triggerExitRuleEvent()
_prevctx = localctx
self.state = 745
self._errHandler.sync(self)
la_ = self._interp.adaptivePredict(self._input,83,self._ctx)
if la_ == 1:
localctx = CoreDSL2Parser.Binary_expressionContext(self, CoreDSL2Parser.ExpressionContext(self, _parentctx, _parentState))
localctx.left = _prevctx
self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
self.state = 692
if not self.precpred(self._ctx, 13):
from antlr4.error.Errors import FailedPredicateException
raise FailedPredicateException(self, "self.precpred(self._ctx, 13)")
self.state = 693
localctx.bop = self._input.LT(1)
_la = self._input.LA(1)
if not((((_la) & ~0x3f) == 0 and ((1 << _la) & 3458764531000410112) != 0)):
localctx.bop = self._errHandler.recoverInline(self)
else:
self._errHandler.reportMatch(self)
self.consume()
self.state = 694
localctx.right = self.expression(14)
pass
elif la_ == 2:
localctx = CoreDSL2Parser.Binary_expressionContext(self, CoreDSL2Parser.ExpressionContext(self, _parentctx, _parentState))
localctx.left = _prevctx
self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
self.state = 695
if not self.precpred(self._ctx, 12):
from antlr4.error.Errors import FailedPredicateException
raise FailedPredicateException(self, "self.precpred(self._ctx, 12)")
self.state = 696
localctx.bop = self._input.LT(1)
_la = self._input.LA(1)
if not(_la==56 or _la==57):
localctx.bop = self._errHandler.recoverInline(self)
else:
self._errHandler.reportMatch(self)
self.consume()
self.state = 697
localctx.right = self.expression(13)
pass
elif la_ == 3:
localctx = CoreDSL2Parser.Binary_expressionContext(self, CoreDSL2Parser.ExpressionContext(self, _parentctx, _parentState))
localctx.left = _prevctx
self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
self.state = 698
if not self.precpred(self._ctx, 11):
from antlr4.error.Errors import FailedPredicateException
raise FailedPredicateException(self, "self.precpred(self._ctx, 11)")
self.state = 699
localctx.bop = self._input.LT(1)
_la = self._input.LA(1)
if not(_la==62 or _la==63):
localctx.bop = self._errHandler.recoverInline(self)
else:
self._errHandler.reportMatch(self)
self.consume()
self.state = 700
localctx.right = self.expression(12)
pass
elif la_ == 4:
localctx = CoreDSL2Parser.Binary_expressionContext(self, CoreDSL2Parser.ExpressionContext(self, _parentctx, _parentState))
localctx.left = _prevctx
self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
self.state = 701
if not self.precpred(self._ctx, 10):
from antlr4.error.Errors import FailedPredicateException
raise FailedPredicateException(self, "self.precpred(self._ctx, 10)")
self.state = 702
localctx.bop = self._input.LT(1)
_la = self._input.LA(1)
if not(((((_la - 36)) & ~0x3f) == 0 and ((1 << (_la - 36)) & 805306371) != 0)):
localctx.bop = self._errHandler.recoverInline(self)
else:
self._errHandler.reportMatch(self)
self.consume()
self.state = 703
localctx.right = self.expression(11)
pass
elif la_ == 5:
localctx = CoreDSL2Parser.Binary_expressionContext(self, CoreDSL2Parser.ExpressionContext(self, _parentctx, _parentState))
localctx.left = _prevctx
self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
self.state = 704
if not self.precpred(self._ctx, 9):
from antlr4.error.Errors import FailedPredicateException
raise FailedPredicateException(self, "self.precpred(self._ctx, 9)")
self.state = 705
localctx.bop = self._input.LT(1)
_la = self._input.LA(1)
if not(_la==66 or _la==67):
localctx.bop = self._errHandler.recoverInline(self)
else:
self._errHandler.reportMatch(self)
self.consume()
self.state = 706
localctx.right = self.expression(10)
pass
elif la_ == 6:
localctx = CoreDSL2Parser.Binary_expressionContext(self, CoreDSL2Parser.ExpressionContext(self, _parentctx, _parentState))
localctx.left = _prevctx
self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
self.state = 707
if not self.precpred(self._ctx, 8):
from antlr4.error.Errors import FailedPredicateException
raise FailedPredicateException(self, "self.precpred(self._ctx, 8)")
self.state = 708
localctx.bop = self.match(CoreDSL2Parser.T__34)
self.state = 709
localctx.right = self.expression(9)
pass
elif la_ == 7:
localctx = CoreDSL2Parser.Binary_expressionContext(self, CoreDSL2Parser.ExpressionContext(self, _parentctx, _parentState))
localctx.left = _prevctx
self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
self.state = 710
if not self.precpred(self._ctx, 7):
from antlr4.error.Errors import FailedPredicateException
raise FailedPredicateException(self, "self.precpred(self._ctx, 7)")
self.state = 711
localctx.bop = self.match(CoreDSL2Parser.T__67)
self.state = 712
localctx.right = self.expression(8)
pass
elif la_ == 8:
localctx = CoreDSL2Parser.Binary_expressionContext(self, CoreDSL2Parser.ExpressionContext(self, _parentctx, _parentState))
localctx.left = _prevctx
self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
self.state = 713
if not self.precpred(self._ctx, 6):
from antlr4.error.Errors import FailedPredicateException
raise FailedPredicateException(self, "self.precpred(self._ctx, 6)")
self.state = 714
localctx.bop = self.match(CoreDSL2Parser.T__68)
self.state = 715
localctx.right = self.expression(7)
pass
elif la_ == 9:
localctx = CoreDSL2Parser.Binary_expressionContext(self, CoreDSL2Parser.ExpressionContext(self, _parentctx, _parentState))
localctx.left = _prevctx
self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
self.state = 716
if not self.precpred(self._ctx, 5):
from antlr4.error.Errors import FailedPredicateException
raise FailedPredicateException(self, "self.precpred(self._ctx, 5)")
self.state = 717
localctx.bop = self.match(CoreDSL2Parser.T__69)
self.state = 718
localctx.right = self.expression(6)
pass
elif la_ == 10:
localctx = CoreDSL2Parser.Binary_expressionContext(self, CoreDSL2Parser.ExpressionContext(self, _parentctx, _parentState))
localctx.left = _prevctx
self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
self.state = 719
if not self.precpred(self._ctx, 4):
from antlr4.error.Errors import FailedPredicateException
raise FailedPredicateException(self, "self.precpred(self._ctx, 4)")
self.state = 720
localctx.bop = self.match(CoreDSL2Parser.T__70)
self.state = 721
localctx.right = self.expression(5)
pass
elif la_ == 11:
localctx = CoreDSL2Parser.Concat_expressionContext(self, CoreDSL2Parser.ExpressionContext(self, _parentctx, _parentState))
localctx.left = _prevctx
self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
self.state = 722
if not self.precpred(self._ctx, 3):
from antlr4.error.Errors import FailedPredicateException
raise FailedPredicateException(self, "self.precpred(self._ctx, 3)")
self.state = 723
localctx.bop = self.match(CoreDSL2Parser.T__15)
self.state = 724
localctx.right = self.expression(4)
pass
elif la_ == 12:
localctx = CoreDSL2Parser.Conditional_expressionContext(self, CoreDSL2Parser.ExpressionContext(self, _parentctx, _parentState))
localctx.cond = _prevctx
self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
self.state = 725
if not self.precpred(self._ctx, 2):
from antlr4.error.Errors import FailedPredicateException
raise FailedPredicateException(self, "self.precpred(self._ctx, 2)")
self.state = 726
localctx.bop = self.match(CoreDSL2Parser.T__71)
self.state = 727
localctx.then_expr = self.expression(0)
self.state = 728
self.match(CoreDSL2Parser.T__14)
self.state = 729
localctx.else_expr = self.expression(2)
pass
elif la_ == 13:
localctx = CoreDSL2Parser.Assignment_expressionContext(self, CoreDSL2Parser.ExpressionContext(self, _parentctx, _parentState))
localctx.left = _prevctx
self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
self.state = 731
if not self.precpred(self._ctx, 1):
from antlr4.error.Errors import FailedPredicateException
raise FailedPredicateException(self, "self.precpred(self._ctx, 1)")
self.state = 732
localctx.bop = self._input.LT(1)
_la = self._input.LA(1)
if not(((((_la - 50)) & ~0x3f) == 0 and ((1 << (_la - 50)) & 17171480577) != 0)):
localctx.bop = self._errHandler.recoverInline(self)
else:
self._errHandler.reportMatch(self)
self.consume()
self.state = 733
localctx.right = self.expression(1)
pass
elif la_ == 14:
localctx = CoreDSL2Parser.Slice_expressionContext(self, CoreDSL2Parser.ExpressionContext(self, _parentctx, _parentState))
localctx.expr = _prevctx
self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
self.state = 734
if not self.precpred(self._ctx, 20):
from antlr4.error.Errors import FailedPredicateException
raise FailedPredicateException(self, "self.precpred(self._ctx, 20)")
self.state = 735
localctx.bop = self.match(CoreDSL2Parser.LEFT_BR)
self.state = 736
localctx.left = self.expression(0)
self.state = 739
self._errHandler.sync(self)
_la = self._input.LA(1)
if _la==15:
self.state = 737
self.match(CoreDSL2Parser.T__14)
self.state = 738
localctx.right = self.expression(0)
self.state = 741
self.match(CoreDSL2Parser.RIGHT_BR)
pass
elif la_ == 15:
localctx = CoreDSL2Parser.Postinc_expressionContext(self, CoreDSL2Parser.ExpressionContext(self, _parentctx, _parentState))
localctx.left = _prevctx
self.pushNewRecursionContext(localctx, _startState, self.RULE_expression)
self.state = 743
if not self.precpred(self._ctx, 18):
from antlr4.error.Errors import FailedPredicateException
raise FailedPredicateException(self, "self.precpred(self._ctx, 18)")
self.state = 744
localctx.op = self._input.LT(1)
_la = self._input.LA(1)
if not(_la==54 or _la==55):
localctx.op = self._errHandler.recoverInline(self)
else:
self._errHandler.reportMatch(self)
self.consume()
pass
self.state = 749
self._errHandler.sync(self)
_alt = self._interp.adaptivePredict(self._input,84,self._ctx)
except RecognitionException as re:
localctx.exception = re
self._errHandler.reportError(self, re)
self._errHandler.recover(self, re)
finally:
self.unrollRecursionContexts(_parentctx)
return localctx
[docs]
class PrimaryContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_primary
[docs]
def copyFrom(self, ctx:ParserRuleContext):
super().copyFrom(ctx)
[docs]
class Reference_expressionContext(PrimaryContext):
def __init__(self, parser, ctx:ParserRuleContext): # actually a CoreDSL2Parser.PrimaryContext
super().__init__(parser)
[docs]
self.ref = None # Token
self.copyFrom(ctx)
[docs]
def IDENTIFIER(self):
return self.getToken(CoreDSL2Parser.IDENTIFIER, 0)
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterReference_expression" ):
listener.enterReference_expression(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitReference_expression" ):
listener.exitReference_expression(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitReference_expression" ):
return visitor.visitReference_expression(self)
else:
return visitor.visitChildren(self)
[docs]
class Constant_expressionContext(PrimaryContext):
def __init__(self, parser, ctx:ParserRuleContext): # actually a CoreDSL2Parser.PrimaryContext
super().__init__(parser)
[docs]
self.const_expr = None # ConstantContext
self.copyFrom(ctx)
[docs]
def constant(self):
return self.getTypedRuleContext(CoreDSL2Parser.ConstantContext,0)
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterConstant_expression" ):
listener.enterConstant_expression(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitConstant_expression" ):
listener.exitConstant_expression(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitConstant_expression" ):
return visitor.visitConstant_expression(self)
else:
return visitor.visitChildren(self)
[docs]
class Literal_expressionContext(PrimaryContext):
def __init__(self, parser, ctx:ParserRuleContext): # actually a CoreDSL2Parser.PrimaryContext
super().__init__(parser)
[docs]
self._string_literal = None # String_literalContext
[docs]
self.literal = list() # of String_literalContexts
self.copyFrom(ctx)
[docs]
def string_literal(self, i:int=None):
if i is None:
return self.getTypedRuleContexts(CoreDSL2Parser.String_literalContext)
else:
return self.getTypedRuleContext(CoreDSL2Parser.String_literalContext,i)
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterLiteral_expression" ):
listener.enterLiteral_expression(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitLiteral_expression" ):
listener.exitLiteral_expression(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitLiteral_expression" ):
return visitor.visitLiteral_expression(self)
else:
return visitor.visitChildren(self)
[docs]
class Parens_expressionContext(PrimaryContext):
def __init__(self, parser, ctx:ParserRuleContext): # actually a CoreDSL2Parser.PrimaryContext
super().__init__(parser)
[docs]
self.expr = None # ExpressionContext
self.copyFrom(ctx)
[docs]
def expression(self):
return self.getTypedRuleContext(CoreDSL2Parser.ExpressionContext,0)
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterParens_expression" ):
listener.enterParens_expression(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitParens_expression" ):
listener.exitParens_expression(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitParens_expression" ):
return visitor.visitParens_expression(self)
else:
return visitor.visitChildren(self)
[docs]
def primary(self):
localctx = CoreDSL2Parser.PrimaryContext(self, self._ctx, self.state)
self.enterRule(localctx, 70, self.RULE_primary)
try:
self.state = 761
self._errHandler.sync(self)
la_ = self._interp.adaptivePredict(self._input,86,self._ctx)
if la_ == 1:
localctx = CoreDSL2Parser.Reference_expressionContext(self, localctx)
self.enterOuterAlt(localctx, 1)
self.state = 750
localctx.ref = self.match(CoreDSL2Parser.IDENTIFIER)
pass
elif la_ == 2:
localctx = CoreDSL2Parser.Constant_expressionContext(self, localctx)
self.enterOuterAlt(localctx, 2)
self.state = 751
localctx.const_expr = self.constant()
pass
elif la_ == 3:
localctx = CoreDSL2Parser.Literal_expressionContext(self, localctx)
self.enterOuterAlt(localctx, 3)
self.state = 753
self._errHandler.sync(self)
_alt = 1
while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
if _alt == 1:
self.state = 752
localctx._string_literal = self.string_literal()
localctx.literal.append(localctx._string_literal)
else:
raise NoViableAltException(self)
self.state = 755
self._errHandler.sync(self)
_alt = self._interp.adaptivePredict(self._input,85,self._ctx)
pass
elif la_ == 4:
localctx = CoreDSL2Parser.Parens_expressionContext(self, localctx)
self.enterOuterAlt(localctx, 4)
self.state = 757
self.match(CoreDSL2Parser.T__19)
self.state = 758
localctx.expr = self.expression(0)
self.state = 759
self.match(CoreDSL2Parser.T__20)
pass
except RecognitionException as re:
localctx.exception = re
self._errHandler.reportError(self, re)
self._errHandler.recover(self, re)
finally:
self.exitRule()
return localctx
[docs]
class String_literalContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
def ENCSTRINGCONST(self):
return self.getToken(CoreDSL2Parser.ENCSTRINGCONST, 0)
[docs]
def STRING(self):
return self.getToken(CoreDSL2Parser.STRING, 0)
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_string_literal
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterString_literal" ):
listener.enterString_literal(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitString_literal" ):
listener.exitString_literal(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitString_literal" ):
return visitor.visitString_literal(self)
else:
return visitor.visitChildren(self)
[docs]
def string_literal(self):
localctx = CoreDSL2Parser.String_literalContext(self, self._ctx, self.state)
self.enterRule(localctx, 72, self.RULE_string_literal)
self._la = 0 # Token type
try:
self.enterOuterAlt(localctx, 1)
self.state = 763
_la = self._input.LA(1)
if not(_la==98 or _la==99):
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
[docs]
class ConstantContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
def integer_constant(self):
return self.getTypedRuleContext(CoreDSL2Parser.Integer_constantContext,0)
[docs]
def floating_constant(self):
return self.getTypedRuleContext(CoreDSL2Parser.Floating_constantContext,0)
[docs]
def character_constant(self):
return self.getTypedRuleContext(CoreDSL2Parser.Character_constantContext,0)
[docs]
def string_constant(self):
return self.getTypedRuleContext(CoreDSL2Parser.String_constantContext,0)
[docs]
def bool_constant(self):
return self.getTypedRuleContext(CoreDSL2Parser.Bool_constantContext,0)
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_constant
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterConstant" ):
listener.enterConstant(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitConstant" ):
listener.exitConstant(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitConstant" ):
return visitor.visitConstant(self)
else:
return visitor.visitChildren(self)
[docs]
def constant(self):
localctx = CoreDSL2Parser.ConstantContext(self, self._ctx, self.state)
self.enterRule(localctx, 74, self.RULE_constant)
try:
self.state = 770
self._errHandler.sync(self)
token = self._input.LA(1)
if token in [95]:
self.enterOuterAlt(localctx, 1)
self.state = 765
self.integer_constant()
pass
elif token in [94]:
self.enterOuterAlt(localctx, 2)
self.state = 766
self.floating_constant()
pass
elif token in [97]:
self.enterOuterAlt(localctx, 3)
self.state = 767
self.character_constant()
pass
elif token in [99]:
self.enterOuterAlt(localctx, 4)
self.state = 768
self.string_constant()
pass
elif token in [93]:
self.enterOuterAlt(localctx, 5)
self.state = 769
self.bool_constant()
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
[docs]
class Integer_constantContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
self.value = None # Token
[docs]
def INTEGER(self):
return self.getToken(CoreDSL2Parser.INTEGER, 0)
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_integer_constant
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterInteger_constant" ):
listener.enterInteger_constant(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitInteger_constant" ):
listener.exitInteger_constant(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitInteger_constant" ):
return visitor.visitInteger_constant(self)
else:
return visitor.visitChildren(self)
[docs]
def integer_constant(self):
localctx = CoreDSL2Parser.Integer_constantContext(self, self._ctx, self.state)
self.enterRule(localctx, 76, self.RULE_integer_constant)
try:
self.enterOuterAlt(localctx, 1)
self.state = 772
localctx.value = self.match(CoreDSL2Parser.INTEGER)
except RecognitionException as re:
localctx.exception = re
self._errHandler.reportError(self, re)
self._errHandler.recover(self, re)
finally:
self.exitRule()
return localctx
[docs]
class Floating_constantContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
self.value = None # Token
[docs]
def FLOAT(self):
return self.getToken(CoreDSL2Parser.FLOAT, 0)
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_floating_constant
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterFloating_constant" ):
listener.enterFloating_constant(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitFloating_constant" ):
listener.exitFloating_constant(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitFloating_constant" ):
return visitor.visitFloating_constant(self)
else:
return visitor.visitChildren(self)
[docs]
def floating_constant(self):
localctx = CoreDSL2Parser.Floating_constantContext(self, self._ctx, self.state)
self.enterRule(localctx, 78, self.RULE_floating_constant)
try:
self.enterOuterAlt(localctx, 1)
self.state = 774
localctx.value = self.match(CoreDSL2Parser.FLOAT)
except RecognitionException as re:
localctx.exception = re
self._errHandler.reportError(self, re)
self._errHandler.recover(self, re)
finally:
self.exitRule()
return localctx
[docs]
class Bool_constantContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
self.value = None # Token
[docs]
def BOOLEAN(self):
return self.getToken(CoreDSL2Parser.BOOLEAN, 0)
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_bool_constant
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterBool_constant" ):
listener.enterBool_constant(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitBool_constant" ):
listener.exitBool_constant(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitBool_constant" ):
return visitor.visitBool_constant(self)
else:
return visitor.visitChildren(self)
[docs]
def bool_constant(self):
localctx = CoreDSL2Parser.Bool_constantContext(self, self._ctx, self.state)
self.enterRule(localctx, 80, self.RULE_bool_constant)
try:
self.enterOuterAlt(localctx, 1)
self.state = 776
localctx.value = self.match(CoreDSL2Parser.BOOLEAN)
except RecognitionException as re:
localctx.exception = re
self._errHandler.reportError(self, re)
self._errHandler.recover(self, re)
finally:
self.exitRule()
return localctx
[docs]
class Character_constantContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
self.value = None # Token
[docs]
def CHARCONST(self):
return self.getToken(CoreDSL2Parser.CHARCONST, 0)
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_character_constant
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterCharacter_constant" ):
listener.enterCharacter_constant(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitCharacter_constant" ):
listener.exitCharacter_constant(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitCharacter_constant" ):
return visitor.visitCharacter_constant(self)
else:
return visitor.visitChildren(self)
[docs]
def character_constant(self):
localctx = CoreDSL2Parser.Character_constantContext(self, self._ctx, self.state)
self.enterRule(localctx, 82, self.RULE_character_constant)
try:
self.enterOuterAlt(localctx, 1)
self.state = 778
localctx.value = self.match(CoreDSL2Parser.CHARCONST)
except RecognitionException as re:
localctx.exception = re
self._errHandler.reportError(self, re)
self._errHandler.recover(self, re)
finally:
self.exitRule()
return localctx
[docs]
class String_constantContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
self.value = None # Token
[docs]
def STRING(self):
return self.getToken(CoreDSL2Parser.STRING, 0)
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_string_constant
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterString_constant" ):
listener.enterString_constant(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitString_constant" ):
listener.exitString_constant(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitString_constant" ):
return visitor.visitString_constant(self)
else:
return visitor.visitChildren(self)
[docs]
def string_constant(self):
localctx = CoreDSL2Parser.String_constantContext(self, self._ctx, self.state)
self.enterRule(localctx, 84, self.RULE_string_constant)
try:
self.enterOuterAlt(localctx, 1)
self.state = 780
localctx.value = self.match(CoreDSL2Parser.STRING)
except RecognitionException as re:
localctx.exception = re
self._errHandler.reportError(self, re)
self._errHandler.recover(self, re)
finally:
self.exitRule()
return localctx
[docs]
class Double_left_bracketContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
def LEFT_BR(self, i:int=None):
if i is None:
return self.getTokens(CoreDSL2Parser.LEFT_BR)
else:
return self.getToken(CoreDSL2Parser.LEFT_BR, i)
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_double_left_bracket
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterDouble_left_bracket" ):
listener.enterDouble_left_bracket(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitDouble_left_bracket" ):
listener.exitDouble_left_bracket(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitDouble_left_bracket" ):
return visitor.visitDouble_left_bracket(self)
else:
return visitor.visitChildren(self)
[docs]
def double_left_bracket(self):
localctx = CoreDSL2Parser.Double_left_bracketContext(self, self._ctx, self.state)
self.enterRule(localctx, 86, self.RULE_double_left_bracket)
try:
self.enterOuterAlt(localctx, 1)
self.state = 782
self.match(CoreDSL2Parser.LEFT_BR)
self.state = 783
self.match(CoreDSL2Parser.LEFT_BR)
except RecognitionException as re:
localctx.exception = re
self._errHandler.reportError(self, re)
self._errHandler.recover(self, re)
finally:
self.exitRule()
return localctx
[docs]
class Double_right_bracketContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
def RIGHT_BR(self, i:int=None):
if i is None:
return self.getTokens(CoreDSL2Parser.RIGHT_BR)
else:
return self.getToken(CoreDSL2Parser.RIGHT_BR, i)
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_double_right_bracket
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterDouble_right_bracket" ):
listener.enterDouble_right_bracket(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitDouble_right_bracket" ):
listener.exitDouble_right_bracket(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitDouble_right_bracket" ):
return visitor.visitDouble_right_bracket(self)
else:
return visitor.visitChildren(self)
[docs]
def double_right_bracket(self):
localctx = CoreDSL2Parser.Double_right_bracketContext(self, self._ctx, self.state)
self.enterRule(localctx, 88, self.RULE_double_right_bracket)
try:
self.enterOuterAlt(localctx, 1)
self.state = 785
self.match(CoreDSL2Parser.RIGHT_BR)
self.state = 786
self.match(CoreDSL2Parser.RIGHT_BR)
except RecognitionException as re:
localctx.exception = re
self._errHandler.reportError(self, re)
self._errHandler.recover(self, re)
finally:
self.exitRule()
return localctx
[docs]
class Data_typesContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_data_types
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterData_types" ):
listener.enterData_types(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitData_types" ):
listener.exitData_types(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitData_types" ):
return visitor.visitData_types(self)
else:
return visitor.visitChildren(self)
[docs]
def data_types(self):
localctx = CoreDSL2Parser.Data_typesContext(self, self._ctx, self.state)
self.enterRule(localctx, 90, self.RULE_data_types)
self._la = 0 # Token type
try:
self.enterOuterAlt(localctx, 1)
self.state = 788
_la = self._input.LA(1)
if not(((((_la - 38)) & ~0x3f) == 0 and ((1 << (_la - 38)) & 70368744179707) != 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
[docs]
class Type_qualifierContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_type_qualifier
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterType_qualifier" ):
listener.enterType_qualifier(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitType_qualifier" ):
listener.exitType_qualifier(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitType_qualifier" ):
return visitor.visitType_qualifier(self)
else:
return visitor.visitChildren(self)
[docs]
def type_qualifier(self):
localctx = CoreDSL2Parser.Type_qualifierContext(self, self._ctx, self.state)
self.enterRule(localctx, 92, self.RULE_type_qualifier)
self._la = 0 # Token type
try:
self.enterOuterAlt(localctx, 1)
self.state = 790
_la = self._input.LA(1)
if not(_la==85 or _la==86):
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
[docs]
class Storage_class_specifierContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_storage_class_specifier
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterStorage_class_specifier" ):
listener.enterStorage_class_specifier(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitStorage_class_specifier" ):
listener.exitStorage_class_specifier(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitStorage_class_specifier" ):
return visitor.visitStorage_class_specifier(self)
else:
return visitor.visitChildren(self)
[docs]
def storage_class_specifier(self):
localctx = CoreDSL2Parser.Storage_class_specifierContext(self, self._ctx, self.state)
self.enterRule(localctx, 94, self.RULE_storage_class_specifier)
self._la = 0 # Token type
try:
self.enterOuterAlt(localctx, 1)
self.state = 792
_la = self._input.LA(1)
if not(_la==19 or _la==87 or _la==88):
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
[docs]
class Struct_or_unionContext(ParserRuleContext):
[docs]
__slots__ = 'parser'
def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
super().__init__(parent, invokingState)
[docs]
self.parser = parser
[docs]
def getRuleIndex(self):
return CoreDSL2Parser.RULE_struct_or_union
[docs]
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterStruct_or_union" ):
listener.enterStruct_or_union(self)
[docs]
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitStruct_or_union" ):
listener.exitStruct_or_union(self)
[docs]
def accept(self, visitor:ParseTreeVisitor):
if hasattr( visitor, "visitStruct_or_union" ):
return visitor.visitStruct_or_union(self)
else:
return visitor.visitChildren(self)
[docs]
def struct_or_union(self):
localctx = CoreDSL2Parser.Struct_or_unionContext(self, self._ctx, self.state)
self.enterRule(localctx, 96, self.RULE_struct_or_union)
self._la = 0 # Token type
try:
self.enterOuterAlt(localctx, 1)
self.state = 794
_la = self._input.LA(1)
if not(_la==89 or _la==90):
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
[docs]
def sempred(self, localctx:RuleContext, ruleIndex:int, predIndex:int):
if self._predicates == None:
self._predicates = dict()
self._predicates[34] = self.expression_sempred
pred = self._predicates.get(ruleIndex, None)
if pred is None:
raise Exception("No predicate with index:" + str(ruleIndex))
else:
return pred(localctx, predIndex)
[docs]
def expression_sempred(self, localctx:ExpressionContext, predIndex:int):
if predIndex == 0:
return self.precpred(self._ctx, 13)
if predIndex == 1:
return self.precpred(self._ctx, 12)
if predIndex == 2:
return self.precpred(self._ctx, 11)
if predIndex == 3:
return self.precpred(self._ctx, 10)
if predIndex == 4:
return self.precpred(self._ctx, 9)
if predIndex == 5:
return self.precpred(self._ctx, 8)
if predIndex == 6:
return self.precpred(self._ctx, 7)
if predIndex == 7:
return self.precpred(self._ctx, 6)
if predIndex == 8:
return self.precpred(self._ctx, 5)
if predIndex == 9:
return self.precpred(self._ctx, 4)
if predIndex == 10:
return self.precpred(self._ctx, 3)
if predIndex == 11:
return self.precpred(self._ctx, 2)
if predIndex == 12:
return self.precpred(self._ctx, 1)
if predIndex == 13:
return self.precpred(self._ctx, 20)
if predIndex == 14:
return self.precpred(self._ctx, 18)