# 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,103,809,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,5,2,138,8,2,10,2,12,2,141,9,2,
1,2,3,2,144,8,2,1,2,1,2,1,2,1,2,1,2,1,2,5,2,152,8,2,10,2,12,2,155,
9,2,3,2,157,8,2,1,2,1,2,5,2,161,8,2,10,2,12,2,164,9,2,1,2,3,2,167,
8,2,1,3,1,3,1,3,1,3,1,3,1,3,4,3,175,8,3,11,3,12,3,176,1,3,1,3,1,
3,1,3,1,3,4,3,184,8,3,11,3,12,3,185,1,3,1,3,1,3,1,3,5,3,192,8,3,
10,3,12,3,195,9,3,1,3,1,3,5,3,199,8,3,10,3,12,3,202,9,3,1,3,1,3,
1,3,5,3,207,8,3,10,3,12,3,210,9,3,1,3,1,3,4,3,214,8,3,11,3,12,3,
215,1,3,1,3,3,3,220,8,3,1,4,1,4,5,4,224,8,4,10,4,12,4,227,9,4,1,
4,1,4,1,5,1,5,5,5,233,8,5,10,5,12,5,236,9,5,1,5,1,5,1,5,1,5,1,5,
1,5,5,5,244,8,5,10,5,12,5,247,9,5,1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,
5,1,5,3,5,258,8,5,1,5,3,5,261,8,5,1,5,1,5,1,5,1,5,1,5,1,6,1,6,1,
6,5,6,271,8,6,10,6,12,6,274,9,6,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,
3,7,284,8,7,1,8,1,8,1,8,1,8,1,8,3,8,291,8,8,1,8,1,8,5,8,295,8,8,
10,8,12,8,298,9,8,1,8,1,8,1,8,1,8,1,8,1,8,3,8,306,8,8,1,8,1,8,5,
8,310,8,8,10,8,12,8,313,9,8,1,8,1,8,3,8,317,8,8,3,8,319,8,8,1,9,
1,9,1,9,5,9,324,8,9,10,9,12,9,327,9,9,1,10,1,10,3,10,331,8,10,1,
11,1,11,1,11,1,11,1,11,1,11,5,11,339,8,11,10,11,12,11,342,9,11,3,
11,344,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,360,8,11,10,11,12,11,363,9,11,1,11,1,11,3,
11,367,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,395,8,11,10,11,12,11,398,9,11,1,11,5,11,401,8,
11,10,11,12,11,404,9,11,1,11,1,11,1,11,1,11,3,11,410,8,11,1,11,1,
11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,3,11,422,8,11,1,12,4,
12,425,8,12,11,12,12,12,426,1,12,4,12,430,8,12,11,12,12,12,431,1,
13,1,13,1,13,1,13,1,13,1,13,3,13,440,8,13,1,14,1,14,5,14,444,8,14,
10,14,12,14,447,9,14,1,14,1,14,1,15,1,15,3,15,453,8,15,1,16,1,16,
3,16,457,8,16,1,16,3,16,460,8,16,1,16,3,16,463,8,16,1,16,1,16,1,
16,1,16,5,16,469,8,16,10,16,12,16,472,9,16,3,16,474,8,16,1,17,1,
17,1,17,5,17,479,8,17,10,17,12,17,482,9,17,1,17,1,17,1,17,1,17,5,
17,488,8,17,10,17,12,17,491,9,17,3,17,493,8,17,1,17,1,17,1,18,1,
18,1,18,3,18,500,8,18,1,19,1,19,1,19,1,19,1,19,1,19,3,19,508,8,19,
1,19,1,19,1,19,1,19,1,19,1,19,3,19,516,8,19,1,19,1,19,5,19,520,8,
19,10,19,12,19,523,9,19,1,19,1,19,1,19,1,19,1,19,1,19,1,19,3,19,
532,8,19,1,19,1,19,1,19,3,19,537,8,19,1,19,1,19,1,19,1,19,3,19,543,
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,559,8,23,10,23,12,23,562,9,23,1,23,1,23,3,23,566,
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,
579,8,24,1,24,1,24,1,25,1,25,1,25,5,25,586,8,25,10,25,12,25,589,
9,25,1,26,1,26,1,26,1,26,3,26,595,8,26,1,27,1,27,1,27,1,27,5,27,
601,8,27,10,27,12,27,604,9,27,1,27,1,27,1,28,1,28,3,28,610,8,28,
1,29,1,29,1,29,1,29,1,29,5,29,617,8,29,10,29,12,29,620,9,29,1,29,
5,29,623,8,29,10,29,12,29,626,9,29,1,29,1,29,3,29,630,8,29,1,30,
1,30,1,30,1,30,3,30,636,8,30,1,30,1,30,3,30,640,8,30,1,31,1,31,3,
31,644,8,31,1,31,1,31,1,31,3,31,649,8,31,5,31,651,8,31,10,31,12,
31,654,9,31,1,32,4,32,657,8,32,11,32,12,32,658,1,32,1,32,1,32,1,
33,1,33,1,33,1,33,1,33,1,33,3,33,670,8,33,1,34,1,34,1,34,1,34,1,
34,1,34,1,34,1,34,1,34,5,34,681,8,34,10,34,12,34,684,9,34,3,34,686,
8,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,1,34,3,34,698,
8,34,1,34,1,34,1,34,3,34,703,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,752,8,34,1,34,1,34,1,34,1,34,5,34,758,8,34,10,34,
12,34,761,9,34,1,35,1,35,1,35,4,35,766,8,35,11,35,12,35,767,1,35,
1,35,1,35,1,35,3,35,774,8,35,1,36,1,36,1,37,1,37,1,37,1,37,1,37,
3,37,783,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,42,43,1,0,44,47,1,0,48,49,
1,0,53,54,1,0,55,56,2,0,35,36,57,58,1,0,59,60,2,0,35,35,61,62,1,
0,57,58,1,0,63,64,2,0,37,38,65,66,1,0,67,68,2,0,51,51,74,84,1,0,
99,100,3,0,39,40,42,49,85,85,1,0,86,87,2,0,20,20,88,89,1,0,90,91,
894,0,101,1,0,0,0,2,109,1,0,0,0,4,166,1,0,0,0,6,219,1,0,0,0,8,221,
1,0,0,0,10,230,1,0,0,0,12,267,1,0,0,0,14,283,1,0,0,0,16,318,1,0,
0,0,18,320,1,0,0,0,20,328,1,0,0,0,22,421,1,0,0,0,24,424,1,0,0,0,
26,439,1,0,0,0,28,441,1,0,0,0,30,452,1,0,0,0,32,459,1,0,0,0,34,480,
1,0,0,0,36,496,1,0,0,0,38,542,1,0,0,0,40,544,1,0,0,0,42,546,1,0,
0,0,44,548,1,0,0,0,46,550,1,0,0,0,48,569,1,0,0,0,50,582,1,0,0,0,
52,594,1,0,0,0,54,596,1,0,0,0,56,609,1,0,0,0,58,611,1,0,0,0,60,639,
1,0,0,0,62,643,1,0,0,0,64,656,1,0,0,0,66,669,1,0,0,0,68,702,1,0,
0,0,70,773,1,0,0,0,72,775,1,0,0,0,74,782,1,0,0,0,76,784,1,0,0,0,
78,786,1,0,0,0,80,788,1,0,0,0,82,790,1,0,0,0,84,792,1,0,0,0,86,794,
1,0,0,0,88,797,1,0,0,0,90,800,1,0,0,0,92,802,1,0,0,0,94,804,1,0,
0,0,96,806,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,100,0,0,111,
3,1,0,0,0,112,113,5,2,0,0,113,143,5,97,0,0,114,115,5,3,0,0,115,120,
5,97,0,0,116,117,5,4,0,0,117,119,5,97,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,144,
5,6,0,0,133,134,5,7,0,0,134,139,5,97,0,0,135,136,5,4,0,0,136,138,
5,97,0,0,137,135,1,0,0,0,138,141,1,0,0,0,139,137,1,0,0,0,139,140,
1,0,0,0,140,142,1,0,0,0,141,139,1,0,0,0,142,144,5,8,0,0,143,123,
1,0,0,0,143,133,1,0,0,0,144,167,1,0,0,0,145,146,5,9,0,0,146,156,
5,97,0,0,147,148,5,10,0,0,148,153,5,97,0,0,149,150,5,4,0,0,150,152,
5,97,0,0,151,149,1,0,0,0,152,155,1,0,0,0,153,151,1,0,0,0,153,154,
1,0,0,0,154,157,1,0,0,0,155,153,1,0,0,0,156,147,1,0,0,0,156,157,
1,0,0,0,157,158,1,0,0,0,158,162,5,5,0,0,159,161,3,6,3,0,160,159,
1,0,0,0,161,164,1,0,0,0,162,160,1,0,0,0,162,163,1,0,0,0,163,165,
1,0,0,0,164,162,1,0,0,0,165,167,5,6,0,0,166,112,1,0,0,0,166,145,
1,0,0,0,167,5,1,0,0,0,168,169,5,11,0,0,169,174,5,5,0,0,170,175,3,
34,17,0,171,172,3,68,34,0,172,173,5,8,0,0,173,175,1,0,0,0,174,170,
1,0,0,0,174,171,1,0,0,0,175,176,1,0,0,0,176,174,1,0,0,0,176,177,
1,0,0,0,177,178,1,0,0,0,178,179,5,6,0,0,179,220,1,0,0,0,180,181,
5,12,0,0,181,183,5,5,0,0,182,184,3,16,8,0,183,182,1,0,0,0,184,185,
1,0,0,0,185,183,1,0,0,0,185,186,1,0,0,0,186,187,1,0,0,0,187,188,
5,6,0,0,188,220,1,0,0,0,189,193,5,13,0,0,190,192,3,46,23,0,191,190,
1,0,0,0,192,195,1,0,0,0,193,191,1,0,0,0,193,194,1,0,0,0,194,196,
1,0,0,0,195,193,1,0,0,0,196,200,5,5,0,0,197,199,3,10,5,0,198,197,
1,0,0,0,199,202,1,0,0,0,200,198,1,0,0,0,200,201,1,0,0,0,201,203,
1,0,0,0,202,200,1,0,0,0,203,220,5,6,0,0,204,208,5,14,0,0,205,207,
3,46,23,0,206,205,1,0,0,0,207,210,1,0,0,0,208,206,1,0,0,0,208,209,
1,0,0,0,209,211,1,0,0,0,210,208,1,0,0,0,211,213,5,5,0,0,212,214,
3,8,4,0,213,212,1,0,0,0,214,215,1,0,0,0,215,213,1,0,0,0,215,216,
1,0,0,0,216,217,1,0,0,0,217,218,5,6,0,0,218,220,1,0,0,0,219,168,
1,0,0,0,219,180,1,0,0,0,219,189,1,0,0,0,219,204,1,0,0,0,220,7,1,
0,0,0,221,225,5,97,0,0,222,224,3,46,23,0,223,222,1,0,0,0,224,227,
1,0,0,0,225,223,1,0,0,0,225,226,1,0,0,0,226,228,1,0,0,0,227,225,
1,0,0,0,228,229,3,28,14,0,229,9,1,0,0,0,230,234,5,97,0,0,231,233,
3,46,23,0,232,231,1,0,0,0,233,236,1,0,0,0,234,232,1,0,0,0,234,235,
1,0,0,0,235,237,1,0,0,0,236,234,1,0,0,0,237,238,5,5,0,0,238,239,
5,15,0,0,239,240,5,16,0,0,240,245,3,14,7,0,241,242,5,17,0,0,242,
244,3,14,7,0,243,241,1,0,0,0,244,247,1,0,0,0,245,243,1,0,0,0,245,
246,1,0,0,0,246,248,1,0,0,0,247,245,1,0,0,0,248,260,5,8,0,0,249,
250,5,18,0,0,250,257,5,16,0,0,251,258,5,100,0,0,252,253,5,5,0,0,
253,254,5,100,0,0,254,255,5,4,0,0,255,256,5,100,0,0,256,258,5,6,
0,0,257,251,1,0,0,0,257,252,1,0,0,0,258,259,1,0,0,0,259,261,5,8,
0,0,260,249,1,0,0,0,260,261,1,0,0,0,261,262,1,0,0,0,262,263,5,19,
0,0,263,264,5,16,0,0,264,265,3,22,11,0,265,266,5,6,0,0,266,11,1,
0,0,0,267,272,3,14,7,0,268,269,5,17,0,0,269,271,3,14,7,0,270,268,
1,0,0,0,271,274,1,0,0,0,272,270,1,0,0,0,272,273,1,0,0,0,273,13,1,
0,0,0,274,272,1,0,0,0,275,284,3,76,38,0,276,277,5,97,0,0,277,278,
5,92,0,0,278,279,3,76,38,0,279,280,5,16,0,0,280,281,3,76,38,0,281,
282,5,93,0,0,282,284,1,0,0,0,283,275,1,0,0,0,283,276,1,0,0,0,284,
15,1,0,0,0,285,286,5,20,0,0,286,287,3,36,18,0,287,288,5,97,0,0,288,
290,5,21,0,0,289,291,3,18,9,0,290,289,1,0,0,0,290,291,1,0,0,0,291,
292,1,0,0,0,292,296,5,22,0,0,293,295,3,46,23,0,294,293,1,0,0,0,295,
298,1,0,0,0,296,294,1,0,0,0,296,297,1,0,0,0,297,299,1,0,0,0,298,
296,1,0,0,0,299,300,5,8,0,0,300,319,1,0,0,0,301,302,3,36,18,0,302,
303,5,97,0,0,303,305,5,21,0,0,304,306,3,18,9,0,305,304,1,0,0,0,305,
306,1,0,0,0,306,307,1,0,0,0,307,311,5,22,0,0,308,310,3,46,23,0,309,
308,1,0,0,0,310,313,1,0,0,0,311,309,1,0,0,0,311,312,1,0,0,0,312,
316,1,0,0,0,313,311,1,0,0,0,314,317,3,28,14,0,315,317,5,8,0,0,316,
314,1,0,0,0,316,315,1,0,0,0,317,319,1,0,0,0,318,285,1,0,0,0,318,
301,1,0,0,0,319,17,1,0,0,0,320,325,3,20,10,0,321,322,5,4,0,0,322,
324,3,20,10,0,323,321,1,0,0,0,324,327,1,0,0,0,325,323,1,0,0,0,325,
326,1,0,0,0,326,19,1,0,0,0,327,325,1,0,0,0,328,330,3,36,18,0,329,
331,3,58,29,0,330,329,1,0,0,0,330,331,1,0,0,0,331,21,1,0,0,0,332,
422,3,28,14,0,333,334,5,97,0,0,334,343,5,21,0,0,335,340,3,68,34,
0,336,337,5,4,0,0,337,339,3,68,34,0,338,336,1,0,0,0,339,342,1,0,
0,0,340,338,1,0,0,0,340,341,1,0,0,0,341,344,1,0,0,0,342,340,1,0,
0,0,343,335,1,0,0,0,343,344,1,0,0,0,344,345,1,0,0,0,345,346,5,22,
0,0,346,422,5,8,0,0,347,348,5,23,0,0,348,349,5,21,0,0,349,350,3,
68,34,0,350,351,5,22,0,0,351,361,3,22,11,0,352,353,5,24,0,0,353,
354,5,23,0,0,354,355,5,21,0,0,355,356,3,68,34,0,356,357,5,22,0,0,
357,358,3,22,11,0,358,360,1,0,0,0,359,352,1,0,0,0,360,363,1,0,0,
0,361,359,1,0,0,0,361,362,1,0,0,0,362,366,1,0,0,0,363,361,1,0,0,
0,364,365,5,24,0,0,365,367,3,22,11,0,366,364,1,0,0,0,366,367,1,0,
0,0,367,422,1,0,0,0,368,369,5,25,0,0,369,370,5,21,0,0,370,371,3,
32,16,0,371,372,5,22,0,0,372,373,3,22,11,0,373,422,1,0,0,0,374,375,
5,26,0,0,375,376,5,21,0,0,376,377,3,68,34,0,377,378,5,22,0,0,378,
379,3,22,11,0,379,422,1,0,0,0,380,381,5,27,0,0,381,382,3,22,11,0,
382,383,5,26,0,0,383,384,5,21,0,0,384,385,3,68,34,0,385,386,5,22,
0,0,386,387,5,8,0,0,387,422,1,0,0,0,388,389,5,28,0,0,389,390,5,21,
0,0,390,391,3,68,34,0,391,392,5,22,0,0,392,396,5,5,0,0,393,395,3,
24,12,0,394,393,1,0,0,0,395,398,1,0,0,0,396,394,1,0,0,0,396,397,
1,0,0,0,397,402,1,0,0,0,398,396,1,0,0,0,399,401,3,26,13,0,400,399,
1,0,0,0,401,404,1,0,0,0,402,400,1,0,0,0,402,403,1,0,0,0,403,405,
1,0,0,0,404,402,1,0,0,0,405,406,5,6,0,0,406,422,1,0,0,0,407,409,
5,29,0,0,408,410,3,68,34,0,409,408,1,0,0,0,409,410,1,0,0,0,410,411,
1,0,0,0,411,422,5,8,0,0,412,413,5,30,0,0,413,422,5,8,0,0,414,415,
5,31,0,0,415,422,5,8,0,0,416,417,5,32,0,0,417,422,3,22,11,0,418,
419,3,68,34,0,419,420,5,8,0,0,420,422,1,0,0,0,421,332,1,0,0,0,421,
333,1,0,0,0,421,347,1,0,0,0,421,368,1,0,0,0,421,374,1,0,0,0,421,
380,1,0,0,0,421,388,1,0,0,0,421,407,1,0,0,0,421,412,1,0,0,0,421,
414,1,0,0,0,421,416,1,0,0,0,421,418,1,0,0,0,422,23,1,0,0,0,423,425,
3,26,13,0,424,423,1,0,0,0,425,426,1,0,0,0,426,424,1,0,0,0,426,427,
1,0,0,0,427,429,1,0,0,0,428,430,3,22,11,0,429,428,1,0,0,0,430,431,
1,0,0,0,431,429,1,0,0,0,431,432,1,0,0,0,432,25,1,0,0,0,433,434,5,
33,0,0,434,435,3,68,34,0,435,436,5,16,0,0,436,440,1,0,0,0,437,438,
5,34,0,0,438,440,5,16,0,0,439,433,1,0,0,0,439,437,1,0,0,0,440,27,
1,0,0,0,441,445,5,5,0,0,442,444,3,30,15,0,443,442,1,0,0,0,444,447,
1,0,0,0,445,443,1,0,0,0,445,446,1,0,0,0,446,448,1,0,0,0,447,445,
1,0,0,0,448,449,5,6,0,0,449,29,1,0,0,0,450,453,3,22,11,0,451,453,
3,34,17,0,452,450,1,0,0,0,452,451,1,0,0,0,453,31,1,0,0,0,454,460,
3,34,17,0,455,457,3,68,34,0,456,455,1,0,0,0,456,457,1,0,0,0,457,
458,1,0,0,0,458,460,5,8,0,0,459,454,1,0,0,0,459,456,1,0,0,0,460,
462,1,0,0,0,461,463,3,68,34,0,462,461,1,0,0,0,462,463,1,0,0,0,463,
464,1,0,0,0,464,473,5,8,0,0,465,470,3,68,34,0,466,467,5,4,0,0,467,
469,3,68,34,0,468,466,1,0,0,0,469,472,1,0,0,0,470,468,1,0,0,0,470,
471,1,0,0,0,471,474,1,0,0,0,472,470,1,0,0,0,473,465,1,0,0,0,473,
474,1,0,0,0,474,33,1,0,0,0,475,479,3,94,47,0,476,479,3,92,46,0,477,
479,3,46,23,0,478,475,1,0,0,0,478,476,1,0,0,0,478,477,1,0,0,0,479,
482,1,0,0,0,480,478,1,0,0,0,480,481,1,0,0,0,481,483,1,0,0,0,482,
480,1,0,0,0,483,492,3,36,18,0,484,489,3,58,29,0,485,486,5,4,0,0,
486,488,3,58,29,0,487,485,1,0,0,0,488,491,1,0,0,0,489,487,1,0,0,
0,489,490,1,0,0,0,490,493,1,0,0,0,491,489,1,0,0,0,492,484,1,0,0,
0,492,493,1,0,0,0,493,494,1,0,0,0,494,495,5,8,0,0,495,35,1,0,0,0,
496,499,3,38,19,0,497,500,5,35,0,0,498,500,5,36,0,0,499,497,1,0,
0,0,499,498,1,0,0,0,499,500,1,0,0,0,500,37,1,0,0,0,501,507,3,40,
20,0,502,508,3,42,21,0,503,504,5,37,0,0,504,505,3,70,35,0,505,506,
5,38,0,0,506,508,1,0,0,0,507,502,1,0,0,0,507,503,1,0,0,0,508,543,
1,0,0,0,509,543,3,42,21,0,510,543,3,44,22,0,511,543,5,39,0,0,512,
543,5,40,0,0,513,515,3,96,48,0,514,516,5,97,0,0,515,514,1,0,0,0,
515,516,1,0,0,0,516,517,1,0,0,0,517,521,5,5,0,0,518,520,3,54,27,
0,519,518,1,0,0,0,520,523,1,0,0,0,521,519,1,0,0,0,521,522,1,0,0,
0,522,524,1,0,0,0,523,521,1,0,0,0,524,525,5,6,0,0,525,543,1,0,0,
0,526,527,3,96,48,0,527,528,5,97,0,0,528,543,1,0,0,0,529,531,5,41,
0,0,530,532,5,97,0,0,531,530,1,0,0,0,531,532,1,0,0,0,532,533,1,0,
0,0,533,534,5,5,0,0,534,536,3,50,25,0,535,537,5,4,0,0,536,535,1,
0,0,0,536,537,1,0,0,0,537,538,1,0,0,0,538,539,5,6,0,0,539,543,1,
0,0,0,540,541,5,41,0,0,541,543,5,97,0,0,542,501,1,0,0,0,542,509,
1,0,0,0,542,510,1,0,0,0,542,511,1,0,0,0,542,512,1,0,0,0,542,513,
1,0,0,0,542,526,1,0,0,0,542,529,1,0,0,0,542,540,1,0,0,0,543,39,1,
0,0,0,544,545,7,0,0,0,545,41,1,0,0,0,546,547,7,1,0,0,547,43,1,0,
0,0,548,549,7,2,0,0,549,45,1,0,0,0,550,551,5,50,0,0,551,565,5,97,
0,0,552,553,5,51,0,0,553,566,3,68,34,0,554,555,5,21,0,0,555,560,
3,68,34,0,556,557,5,4,0,0,557,559,3,68,34,0,558,556,1,0,0,0,559,
562,1,0,0,0,560,558,1,0,0,0,560,561,1,0,0,0,561,563,1,0,0,0,562,
560,1,0,0,0,563,564,5,22,0,0,564,566,1,0,0,0,565,552,1,0,0,0,565,
554,1,0,0,0,565,566,1,0,0,0,566,567,1,0,0,0,567,568,5,52,0,0,568,
47,1,0,0,0,569,570,5,37,0,0,570,578,3,70,35,0,571,572,5,4,0,0,572,
573,3,70,35,0,573,574,5,4,0,0,574,575,3,70,35,0,575,576,5,4,0,0,
576,577,3,70,35,0,577,579,1,0,0,0,578,571,1,0,0,0,578,579,1,0,0,
0,579,580,1,0,0,0,580,581,5,38,0,0,581,49,1,0,0,0,582,587,3,52,26,
0,583,584,5,4,0,0,584,586,3,52,26,0,585,583,1,0,0,0,586,589,1,0,
0,0,587,585,1,0,0,0,587,588,1,0,0,0,588,51,1,0,0,0,589,587,1,0,0,
0,590,595,5,97,0,0,591,592,5,97,0,0,592,593,5,51,0,0,593,595,3,68,
34,0,594,590,1,0,0,0,594,591,1,0,0,0,595,53,1,0,0,0,596,597,3,56,
28,0,597,602,3,58,29,0,598,599,5,4,0,0,599,601,3,58,29,0,600,598,
1,0,0,0,601,604,1,0,0,0,602,600,1,0,0,0,602,603,1,0,0,0,603,605,
1,0,0,0,604,602,1,0,0,0,605,606,5,8,0,0,606,55,1,0,0,0,607,610,3,
36,18,0,608,610,3,92,46,0,609,607,1,0,0,0,609,608,1,0,0,0,610,57,
1,0,0,0,611,618,5,97,0,0,612,613,5,92,0,0,613,614,3,68,34,0,614,
615,5,93,0,0,615,617,1,0,0,0,616,612,1,0,0,0,617,620,1,0,0,0,618,
616,1,0,0,0,618,619,1,0,0,0,619,624,1,0,0,0,620,618,1,0,0,0,621,
623,3,46,23,0,622,621,1,0,0,0,623,626,1,0,0,0,624,622,1,0,0,0,624,
625,1,0,0,0,625,629,1,0,0,0,626,624,1,0,0,0,627,628,5,51,0,0,628,
630,3,60,30,0,629,627,1,0,0,0,629,630,1,0,0,0,630,59,1,0,0,0,631,
640,3,68,34,0,632,633,5,5,0,0,633,635,3,62,31,0,634,636,5,4,0,0,
635,634,1,0,0,0,635,636,1,0,0,0,636,637,1,0,0,0,637,638,5,6,0,0,
638,640,1,0,0,0,639,631,1,0,0,0,639,632,1,0,0,0,640,61,1,0,0,0,641,
644,3,64,32,0,642,644,3,60,30,0,643,641,1,0,0,0,643,642,1,0,0,0,
644,652,1,0,0,0,645,648,5,4,0,0,646,649,3,64,32,0,647,649,3,60,30,
0,648,646,1,0,0,0,648,647,1,0,0,0,649,651,1,0,0,0,650,645,1,0,0,
0,651,654,1,0,0,0,652,650,1,0,0,0,652,653,1,0,0,0,653,63,1,0,0,0,
654,652,1,0,0,0,655,657,3,66,33,0,656,655,1,0,0,0,657,658,1,0,0,
0,658,656,1,0,0,0,658,659,1,0,0,0,659,660,1,0,0,0,660,661,5,51,0,
0,661,662,3,60,30,0,662,65,1,0,0,0,663,664,5,92,0,0,664,665,3,68,
34,0,665,666,5,93,0,0,666,670,1,0,0,0,667,668,5,53,0,0,668,670,5,
97,0,0,669,663,1,0,0,0,669,667,1,0,0,0,670,67,1,0,0,0,671,672,6,
34,-1,0,672,703,3,70,35,0,673,674,7,3,0,0,674,703,5,97,0,0,675,676,
5,97,0,0,676,685,5,21,0,0,677,682,3,68,34,0,678,679,5,4,0,0,679,
681,3,68,34,0,680,678,1,0,0,0,681,684,1,0,0,0,682,680,1,0,0,0,682,
683,1,0,0,0,683,686,1,0,0,0,684,682,1,0,0,0,685,677,1,0,0,0,685,
686,1,0,0,0,686,687,1,0,0,0,687,703,5,22,0,0,688,689,7,4,0,0,689,
703,3,68,34,17,690,691,7,5,0,0,691,703,3,68,34,16,692,693,7,6,0,
0,693,703,3,68,34,15,694,697,5,21,0,0,695,698,3,36,18,0,696,698,
3,40,20,0,697,695,1,0,0,0,697,696,1,0,0,0,698,699,1,0,0,0,699,700,
5,22,0,0,700,701,3,68,34,14,701,703,1,0,0,0,702,671,1,0,0,0,702,
673,1,0,0,0,702,675,1,0,0,0,702,688,1,0,0,0,702,690,1,0,0,0,702,
692,1,0,0,0,702,694,1,0,0,0,703,759,1,0,0,0,704,705,10,13,0,0,705,
706,7,7,0,0,706,758,3,68,34,14,707,708,10,12,0,0,708,709,7,8,0,0,
709,758,3,68,34,13,710,711,10,11,0,0,711,712,7,9,0,0,712,758,3,68,
34,12,713,714,10,10,0,0,714,715,7,10,0,0,715,758,3,68,34,11,716,
717,10,9,0,0,717,718,7,11,0,0,718,758,3,68,34,10,719,720,10,8,0,
0,720,721,5,36,0,0,721,758,3,68,34,9,722,723,10,7,0,0,723,724,5,
69,0,0,724,758,3,68,34,8,725,726,10,6,0,0,726,727,5,70,0,0,727,758,
3,68,34,7,728,729,10,5,0,0,729,730,5,71,0,0,730,758,3,68,34,6,731,
732,10,4,0,0,732,733,5,72,0,0,733,758,3,68,34,5,734,735,10,3,0,0,
735,736,5,17,0,0,736,758,3,68,34,4,737,738,10,2,0,0,738,739,5,73,
0,0,739,740,3,68,34,0,740,741,5,16,0,0,741,742,3,68,34,2,742,758,
1,0,0,0,743,744,10,1,0,0,744,745,7,12,0,0,745,758,3,68,34,1,746,
747,10,20,0,0,747,748,5,92,0,0,748,751,3,68,34,0,749,750,5,16,0,
0,750,752,3,68,34,0,751,749,1,0,0,0,751,752,1,0,0,0,752,753,1,0,
0,0,753,754,5,93,0,0,754,758,1,0,0,0,755,756,10,18,0,0,756,758,7,
4,0,0,757,704,1,0,0,0,757,707,1,0,0,0,757,710,1,0,0,0,757,713,1,
0,0,0,757,716,1,0,0,0,757,719,1,0,0,0,757,722,1,0,0,0,757,725,1,
0,0,0,757,728,1,0,0,0,757,731,1,0,0,0,757,734,1,0,0,0,757,737,1,
0,0,0,757,743,1,0,0,0,757,746,1,0,0,0,757,755,1,0,0,0,758,761,1,
0,0,0,759,757,1,0,0,0,759,760,1,0,0,0,760,69,1,0,0,0,761,759,1,0,
0,0,762,774,5,97,0,0,763,774,3,74,37,0,764,766,3,72,36,0,765,764,
1,0,0,0,766,767,1,0,0,0,767,765,1,0,0,0,767,768,1,0,0,0,768,774,
1,0,0,0,769,770,5,21,0,0,770,771,3,68,34,0,771,772,5,22,0,0,772,
774,1,0,0,0,773,762,1,0,0,0,773,763,1,0,0,0,773,765,1,0,0,0,773,
769,1,0,0,0,774,71,1,0,0,0,775,776,7,13,0,0,776,73,1,0,0,0,777,783,
3,76,38,0,778,783,3,78,39,0,779,783,3,82,41,0,780,783,3,84,42,0,
781,783,3,80,40,0,782,777,1,0,0,0,782,778,1,0,0,0,782,779,1,0,0,
0,782,780,1,0,0,0,782,781,1,0,0,0,783,75,1,0,0,0,784,785,5,96,0,
0,785,77,1,0,0,0,786,787,5,95,0,0,787,79,1,0,0,0,788,789,5,94,0,
0,789,81,1,0,0,0,790,791,5,98,0,0,791,83,1,0,0,0,792,793,5,100,0,
0,793,85,1,0,0,0,794,795,5,92,0,0,795,796,5,92,0,0,796,87,1,0,0,
0,797,798,5,93,0,0,798,799,5,93,0,0,799,89,1,0,0,0,800,801,7,14,
0,0,801,91,1,0,0,0,802,803,7,15,0,0,803,93,1,0,0,0,804,805,7,16,
0,0,805,95,1,0,0,0,806,807,7,17,0,0,807,97,1,0,0,0,90,101,107,120,
123,129,139,143,153,156,162,166,174,176,185,193,200,208,215,219,
225,234,245,257,260,272,283,290,296,305,311,316,318,325,330,340,
343,361,366,396,402,409,421,426,431,439,445,452,456,459,462,470,
473,478,480,489,492,499,507,515,521,531,536,542,560,565,578,587,
594,602,609,618,624,629,635,639,643,648,652,658,669,682,685,697,
702,751,757,759,767,773,782
]
[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'",
"','", "'{'", "'}'", "'combines'", "';'", "'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>", "<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==9):
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
[docs]
self.combines = list() # of Tokens
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 = 166
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 = 143
self._errHandler.sync(self)
token = self._input.LA(1)
if token in [3, 5]:
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) & 30720) != 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]:
self.state = 133
self.match(CoreDSL2Parser.T__6)
self.state = 134
localctx._IDENTIFIER = self.match(CoreDSL2Parser.IDENTIFIER)
localctx.combines.append(localctx._IDENTIFIER)
self.state = 139
self._errHandler.sync(self)
_la = self._input.LA(1)
while _la==4:
self.state = 135
self.match(CoreDSL2Parser.T__3)
self.state = 136
localctx._IDENTIFIER = self.match(CoreDSL2Parser.IDENTIFIER)
localctx.combines.append(localctx._IDENTIFIER)
self.state = 141
self._errHandler.sync(self)
_la = self._input.LA(1)
self.state = 142
self.match(CoreDSL2Parser.T__7)
pass
else:
raise NoViableAltException(self)
pass
elif token in [9]:
localctx = CoreDSL2Parser.Core_defContext(self, localctx)
self.enterOuterAlt(localctx, 2)
self.state = 145
self.match(CoreDSL2Parser.T__8)
self.state = 146
localctx.name = self.match(CoreDSL2Parser.IDENTIFIER)
self.state = 156
self._errHandler.sync(self)
_la = self._input.LA(1)
if _la==10:
self.state = 147
self.match(CoreDSL2Parser.T__9)
self.state = 148
localctx._IDENTIFIER = self.match(CoreDSL2Parser.IDENTIFIER)
localctx.contributing_types.append(localctx._IDENTIFIER)
self.state = 153
self._errHandler.sync(self)
_la = self._input.LA(1)
while _la==4:
self.state = 149
self.match(CoreDSL2Parser.T__3)
self.state = 150
localctx._IDENTIFIER = self.match(CoreDSL2Parser.IDENTIFIER)
localctx.contributing_types.append(localctx._IDENTIFIER)
self.state = 155
self._errHandler.sync(self)
_la = self._input.LA(1)
self.state = 158
self.match(CoreDSL2Parser.T__4)
self.state = 162
self._errHandler.sync(self)
_la = self._input.LA(1)
while (((_la) & ~0x3f) == 0 and ((1 << _la) & 30720) != 0):
self.state = 159
localctx._section = self.section()
localctx.sections.append(localctx._section)
self.state = 164
self._errHandler.sync(self)
_la = self._input.LA(1)
self.state = 165
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 = 219
self._errHandler.sync(self)
token = self._input.LA(1)
if token in [11]:
localctx = CoreDSL2Parser.Section_arch_stateContext(self, localctx)
self.enterOuterAlt(localctx, 1)
self.state = 168
localctx.type_ = self.match(CoreDSL2Parser.T__10)
self.state = 169
self.match(CoreDSL2Parser.T__4)
self.state = 174
self._errHandler.sync(self)
_la = self._input.LA(1)
while True:
self.state = 174
self._errHandler.sync(self)
token = self._input.LA(1)
if token in [20, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 86, 87, 88, 89, 90, 91]:
self.state = 170
localctx._declaration = self.declaration()
localctx.declarations.append(localctx._declaration)
pass
elif token in [21, 35, 36, 53, 54, 55, 56, 57, 58, 59, 60, 94, 95, 96, 97, 98, 99, 100]:
self.state = 171
localctx._expression = self.expression(0)
localctx.expressions.append(localctx._expression)
self.state = 172
self.match(CoreDSL2Parser.T__7)
pass
else:
raise NoViableAltException(self)
self.state = 176
self._errHandler.sync(self)
_la = self._input.LA(1)
if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & 2299087163099185152) != 0) or ((((_la - 86)) & ~0x3f) == 0 and ((1 << (_la - 86)) & 32575) != 0)):
break
self.state = 178
self.match(CoreDSL2Parser.T__5)
pass
elif token in [12]:
localctx = CoreDSL2Parser.Section_functionsContext(self, localctx)
self.enterOuterAlt(localctx, 2)
self.state = 180
localctx.type_ = self.match(CoreDSL2Parser.T__11)
self.state = 181
self.match(CoreDSL2Parser.T__4)
self.state = 183
self._errHandler.sync(self)
_la = self._input.LA(1)
while True:
self.state = 182
localctx._function_definition = self.function_definition()
localctx.functions.append(localctx._function_definition)
self.state = 185
self._errHandler.sync(self)
_la = self._input.LA(1)
if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & 1125350152077312) != 0) or _la==90 or _la==91):
break
self.state = 187
self.match(CoreDSL2Parser.T__5)
pass
elif token in [13]:
localctx = CoreDSL2Parser.Section_instructionsContext(self, localctx)
self.enterOuterAlt(localctx, 3)
self.state = 189
localctx.type_ = self.match(CoreDSL2Parser.T__12)
self.state = 193
self._errHandler.sync(self)
_la = self._input.LA(1)
while _la==50:
self.state = 190
localctx._attribute = self.attribute()
localctx.attributes.append(localctx._attribute)
self.state = 195
self._errHandler.sync(self)
_la = self._input.LA(1)
self.state = 196
self.match(CoreDSL2Parser.T__4)
self.state = 200
self._errHandler.sync(self)
_la = self._input.LA(1)
while _la==97:
self.state = 197
localctx._instruction = self.instruction()
localctx.instructions.append(localctx._instruction)
self.state = 202
self._errHandler.sync(self)
_la = self._input.LA(1)
self.state = 203
self.match(CoreDSL2Parser.T__5)
pass
elif token in [14]:
localctx = CoreDSL2Parser.Section_alwaysContext(self, localctx)
self.enterOuterAlt(localctx, 4)
self.state = 204
localctx.type_ = self.match(CoreDSL2Parser.T__13)
self.state = 208
self._errHandler.sync(self)
_la = self._input.LA(1)
while _la==50:
self.state = 205
localctx._attribute = self.attribute()
localctx.attributes.append(localctx._attribute)
self.state = 210
self._errHandler.sync(self)
_la = self._input.LA(1)
self.state = 211
self.match(CoreDSL2Parser.T__4)
self.state = 213
self._errHandler.sync(self)
_la = self._input.LA(1)
while True:
self.state = 212
localctx._always_block = self.always_block()
localctx.always_blocks.append(localctx._always_block)
self.state = 215
self._errHandler.sync(self)
_la = self._input.LA(1)
if not (_la==97):
break
self.state = 217
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 = 221
localctx.name = self.match(CoreDSL2Parser.IDENTIFIER)
self.state = 225
self._errHandler.sync(self)
_la = self._input.LA(1)
while _la==50:
self.state = 222
localctx._attribute = self.attribute()
localctx.attributes.append(localctx._attribute)
self.state = 227
self._errHandler.sync(self)
_la = self._input.LA(1)
self.state = 228
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 = 230
localctx.name = self.match(CoreDSL2Parser.IDENTIFIER)
self.state = 234
self._errHandler.sync(self)
_la = self._input.LA(1)
while _la==50:
self.state = 231
localctx._attribute = self.attribute()
localctx.attributes.append(localctx._attribute)
self.state = 236
self._errHandler.sync(self)
_la = self._input.LA(1)
self.state = 237
self.match(CoreDSL2Parser.T__4)
self.state = 238
self.match(CoreDSL2Parser.T__14)
self.state = 239
self.match(CoreDSL2Parser.T__15)
self.state = 240
localctx._encoding_entry = self.encoding_entry()
localctx.encoding.append(localctx._encoding_entry)
self.state = 245
self._errHandler.sync(self)
_la = self._input.LA(1)
while _la==17:
self.state = 241
self.match(CoreDSL2Parser.T__16)
self.state = 242
localctx._encoding_entry = self.encoding_entry()
localctx.encoding.append(localctx._encoding_entry)
self.state = 247
self._errHandler.sync(self)
_la = self._input.LA(1)
self.state = 248
self.match(CoreDSL2Parser.T__7)
self.state = 260
self._errHandler.sync(self)
_la = self._input.LA(1)
if _la==18:
self.state = 249
self.match(CoreDSL2Parser.T__17)
self.state = 250
self.match(CoreDSL2Parser.T__15)
self.state = 257
self._errHandler.sync(self)
token = self._input.LA(1)
if token in [100]:
self.state = 251
localctx.assembly = self.match(CoreDSL2Parser.STRING)
pass
elif token in [5]:
self.state = 252
self.match(CoreDSL2Parser.T__4)
self.state = 253
localctx.mnemonic = self.match(CoreDSL2Parser.STRING)
self.state = 254
self.match(CoreDSL2Parser.T__3)
self.state = 255
localctx.assembly = self.match(CoreDSL2Parser.STRING)
self.state = 256
self.match(CoreDSL2Parser.T__5)
pass
else:
raise NoViableAltException(self)
self.state = 259
self.match(CoreDSL2Parser.T__7)
self.state = 262
self.match(CoreDSL2Parser.T__18)
self.state = 263
self.match(CoreDSL2Parser.T__15)
self.state = 264
localctx.behavior = self.statement()
self.state = 265
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 = 267
localctx._encoding_entry = self.encoding_entry()
localctx.fields.append(localctx._encoding_entry)
self.state = 272
self._errHandler.sync(self)
_la = self._input.LA(1)
while _la==17:
self.state = 268
self.match(CoreDSL2Parser.T__16)
self.state = 269
localctx._encoding_entry = self.encoding_entry()
localctx.fields.append(localctx._encoding_entry)
self.state = 274
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 = 283
self._errHandler.sync(self)
token = self._input.LA(1)
if token in [96]:
localctx = CoreDSL2Parser.Bit_valueContext(self, localctx)
self.enterOuterAlt(localctx, 1)
self.state = 275
localctx.value = self.integer_constant()
pass
elif token in [97]:
localctx = CoreDSL2Parser.Bit_fieldContext(self, localctx)
self.enterOuterAlt(localctx, 2)
self.state = 276
localctx.name = self.match(CoreDSL2Parser.IDENTIFIER)
self.state = 277
self.match(CoreDSL2Parser.LEFT_BR)
self.state = 278
localctx.left = self.integer_constant()
self.state = 279
self.match(CoreDSL2Parser.T__15)
self.state = 280
localctx.right = self.integer_constant()
self.state = 281
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 = 318
self._errHandler.sync(self)
token = self._input.LA(1)
if token in [20]:
self.enterOuterAlt(localctx, 1)
self.state = 285
localctx.extern = self.match(CoreDSL2Parser.T__19)
self.state = 286
localctx.type_ = self.type_specifier()
self.state = 287
localctx.name = self.match(CoreDSL2Parser.IDENTIFIER)
self.state = 288
self.match(CoreDSL2Parser.T__20)
self.state = 290
self._errHandler.sync(self)
_la = self._input.LA(1)
if ((((_la - 39)) & ~0x3f) == 0 and ((1 << (_la - 39)) & 6755399441057791) != 0):
self.state = 289
localctx.params = self.parameter_list()
self.state = 292
self.match(CoreDSL2Parser.T__21)
self.state = 296
self._errHandler.sync(self)
_la = self._input.LA(1)
while _la==50:
self.state = 293
localctx._attribute = self.attribute()
localctx.attributes.append(localctx._attribute)
self.state = 298
self._errHandler.sync(self)
_la = self._input.LA(1)
self.state = 299
self.match(CoreDSL2Parser.T__7)
pass
elif token in [39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 90, 91]:
self.enterOuterAlt(localctx, 2)
self.state = 301
localctx.type_ = self.type_specifier()
self.state = 302
localctx.name = self.match(CoreDSL2Parser.IDENTIFIER)
self.state = 303
self.match(CoreDSL2Parser.T__20)
self.state = 305
self._errHandler.sync(self)
_la = self._input.LA(1)
if ((((_la - 39)) & ~0x3f) == 0 and ((1 << (_la - 39)) & 6755399441057791) != 0):
self.state = 304
localctx.params = self.parameter_list()
self.state = 307
self.match(CoreDSL2Parser.T__21)
self.state = 311
self._errHandler.sync(self)
_la = self._input.LA(1)
while _la==50:
self.state = 308
localctx._attribute = self.attribute()
localctx.attributes.append(localctx._attribute)
self.state = 313
self._errHandler.sync(self)
_la = self._input.LA(1)
self.state = 316
self._errHandler.sync(self)
token = self._input.LA(1)
if token in [5]:
self.state = 314
localctx.behavior = self.block()
pass
elif token in [8]:
self.state = 315
self.match(CoreDSL2Parser.T__7)
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 = 320
localctx._parameter_declaration = self.parameter_declaration()
localctx.params.append(localctx._parameter_declaration)
self.state = 325
self._errHandler.sync(self)
_la = self._input.LA(1)
while _la==4:
self.state = 321
self.match(CoreDSL2Parser.T__3)
self.state = 322
localctx._parameter_declaration = self.parameter_declaration()
localctx.params.append(localctx._parameter_declaration)
self.state = 327
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 = 328
localctx.type_ = self.type_specifier()
self.state = 330
self._errHandler.sync(self)
_la = self._input.LA(1)
if _la==97:
self.state = 329
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 = 421
self._errHandler.sync(self)
la_ = self._interp.adaptivePredict(self._input,41,self._ctx)
if la_ == 1:
localctx = CoreDSL2Parser.Block_statementContext(self, localctx)
self.enterOuterAlt(localctx, 1)
self.state = 332
self.block()
pass
elif la_ == 2:
localctx = CoreDSL2Parser.Procedure_callContext(self, localctx)
self.enterOuterAlt(localctx, 2)
self.state = 333
localctx.ref = self.match(CoreDSL2Parser.IDENTIFIER)
self.state = 334
self.match(CoreDSL2Parser.T__20)
self.state = 343
self._errHandler.sync(self)
_la = self._input.LA(1)
if (((_la) & ~0x3f) == 0 and ((1 << _la) & 2296835913040265216) != 0) or ((((_la - 94)) & ~0x3f) == 0 and ((1 << (_la - 94)) & 127) != 0):
self.state = 335
localctx._expression = self.expression(0)
localctx.args.append(localctx._expression)
self.state = 340
self._errHandler.sync(self)
_la = self._input.LA(1)
while _la==4:
self.state = 336
self.match(CoreDSL2Parser.T__3)
self.state = 337
localctx._expression = self.expression(0)
localctx.args.append(localctx._expression)
self.state = 342
self._errHandler.sync(self)
_la = self._input.LA(1)
self.state = 345
self.match(CoreDSL2Parser.T__21)
self.state = 346
self.match(CoreDSL2Parser.T__7)
pass
elif la_ == 3:
localctx = CoreDSL2Parser.If_statementContext(self, localctx)
self.enterOuterAlt(localctx, 3)
self.state = 347
localctx.type_ = self.match(CoreDSL2Parser.T__22)
self.state = 348
self.match(CoreDSL2Parser.T__20)
self.state = 349
localctx._expression = self.expression(0)
localctx.cond.append(localctx._expression)
self.state = 350
self.match(CoreDSL2Parser.T__21)
self.state = 351
localctx._statement = self.statement()
localctx.stmt.append(localctx._statement)
self.state = 361
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 = 352
self.match(CoreDSL2Parser.T__23)
self.state = 353
self.match(CoreDSL2Parser.T__22)
self.state = 354
self.match(CoreDSL2Parser.T__20)
self.state = 355
localctx._expression = self.expression(0)
localctx.cond.append(localctx._expression)
self.state = 356
self.match(CoreDSL2Parser.T__21)
self.state = 357
localctx._statement = self.statement()
localctx.stmt.append(localctx._statement)
self.state = 363
self._errHandler.sync(self)
_alt = self._interp.adaptivePredict(self._input,36,self._ctx)
self.state = 366
self._errHandler.sync(self)
la_ = self._interp.adaptivePredict(self._input,37,self._ctx)
if la_ == 1:
self.state = 364
self.match(CoreDSL2Parser.T__23)
self.state = 365
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 = 368
localctx.type_ = self.match(CoreDSL2Parser.T__24)
self.state = 369
self.match(CoreDSL2Parser.T__20)
self.state = 370
localctx.cond = self.for_condition()
self.state = 371
self.match(CoreDSL2Parser.T__21)
self.state = 372
localctx.stmt = self.statement()
pass
elif la_ == 5:
localctx = CoreDSL2Parser.While_statementContext(self, localctx)
self.enterOuterAlt(localctx, 5)
self.state = 374
localctx.type_ = self.match(CoreDSL2Parser.T__25)
self.state = 375
self.match(CoreDSL2Parser.T__20)
self.state = 376
localctx.cond = self.expression(0)
self.state = 377
self.match(CoreDSL2Parser.T__21)
self.state = 378
localctx.stmt = self.statement()
pass
elif la_ == 6:
localctx = CoreDSL2Parser.Do_statementContext(self, localctx)
self.enterOuterAlt(localctx, 6)
self.state = 380
localctx.type_ = self.match(CoreDSL2Parser.T__26)
self.state = 381
localctx.stmt = self.statement()
self.state = 382
self.match(CoreDSL2Parser.T__25)
self.state = 383
self.match(CoreDSL2Parser.T__20)
self.state = 384
localctx.cond = self.expression(0)
self.state = 385
self.match(CoreDSL2Parser.T__21)
self.state = 386
self.match(CoreDSL2Parser.T__7)
pass
elif la_ == 7:
localctx = CoreDSL2Parser.Switch_statementContext(self, localctx)
self.enterOuterAlt(localctx, 7)
self.state = 388
localctx.type_ = self.match(CoreDSL2Parser.T__27)
self.state = 389
self.match(CoreDSL2Parser.T__20)
self.state = 390
localctx.cond = self.expression(0)
self.state = 391
self.match(CoreDSL2Parser.T__21)
self.state = 392
self.match(CoreDSL2Parser.T__4)
self.state = 396
self._errHandler.sync(self)
_alt = self._interp.adaptivePredict(self._input,38,self._ctx)
while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
if _alt==1:
self.state = 393
localctx._switch_block_statement_group = self.switch_block_statement_group()
localctx.items.append(localctx._switch_block_statement_group)
self.state = 398
self._errHandler.sync(self)
_alt = self._interp.adaptivePredict(self._input,38,self._ctx)
self.state = 402
self._errHandler.sync(self)
_la = self._input.LA(1)
while _la==33 or _la==34:
self.state = 399
self.switch_label()
self.state = 404
self._errHandler.sync(self)
_la = self._input.LA(1)
self.state = 405
self.match(CoreDSL2Parser.T__5)
pass
elif la_ == 8:
localctx = CoreDSL2Parser.Return_statementContext(self, localctx)
self.enterOuterAlt(localctx, 8)
self.state = 407
localctx.type_ = self.match(CoreDSL2Parser.T__28)
self.state = 409
self._errHandler.sync(self)
_la = self._input.LA(1)
if (((_la) & ~0x3f) == 0 and ((1 << _la) & 2296835913040265216) != 0) or ((((_la - 94)) & ~0x3f) == 0 and ((1 << (_la - 94)) & 127) != 0):
self.state = 408
localctx.expr = self.expression(0)
self.state = 411
self.match(CoreDSL2Parser.T__7)
pass
elif la_ == 9:
localctx = CoreDSL2Parser.Break_statementContext(self, localctx)
self.enterOuterAlt(localctx, 9)
self.state = 412
localctx.type_ = self.match(CoreDSL2Parser.T__29)
self.state = 413
self.match(CoreDSL2Parser.T__7)
pass
elif la_ == 10:
localctx = CoreDSL2Parser.Continue_statementContext(self, localctx)
self.enterOuterAlt(localctx, 10)
self.state = 414
localctx.type_ = self.match(CoreDSL2Parser.T__30)
self.state = 415
self.match(CoreDSL2Parser.T__7)
pass
elif la_ == 11:
localctx = CoreDSL2Parser.Spawn_statementContext(self, localctx)
self.enterOuterAlt(localctx, 11)
self.state = 416
localctx.type_ = self.match(CoreDSL2Parser.T__31)
self.state = 417
localctx.stmt = self.statement()
pass
elif la_ == 12:
localctx = CoreDSL2Parser.Expression_statementContext(self, localctx)
self.enterOuterAlt(localctx, 12)
self.state = 418
localctx.expr = self.expression(0)
self.state = 419
self.match(CoreDSL2Parser.T__7)
pass
except RecognitionException as re:
localctx.exception = re
self._errHandler.reportError(self, re)
self._errHandler.recover(self, re)
finally:
self.exitRule()
return localctx
[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 = 424
self._errHandler.sync(self)
_la = self._input.LA(1)
while True:
self.state = 423
localctx._switch_label = self.switch_label()
localctx.labels.append(localctx._switch_label)
self.state = 426
self._errHandler.sync(self)
_la = self._input.LA(1)
if not (_la==33 or _la==34):
break
self.state = 429
self._errHandler.sync(self)
_la = self._input.LA(1)
while True:
self.state = 428
localctx._statement = self.statement()
localctx.statements.append(localctx._statement)
self.state = 431
self._errHandler.sync(self)
_la = self._input.LA(1)
if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & 2296835921605034016) != 0) or ((((_la - 94)) & ~0x3f) == 0 and ((1 << (_la - 94)) & 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 = 439
self._errHandler.sync(self)
token = self._input.LA(1)
if token in [33]:
self.enterOuterAlt(localctx, 1)
self.state = 433
self.match(CoreDSL2Parser.T__32)
self.state = 434
localctx.const_expr = self.expression(0)
self.state = 435
self.match(CoreDSL2Parser.T__15)
pass
elif token in [34]:
self.enterOuterAlt(localctx, 2)
self.state = 437
self.match(CoreDSL2Parser.T__33)
self.state = 438
self.match(CoreDSL2Parser.T__15)
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 = 441
self.match(CoreDSL2Parser.T__4)
self.state = 445
self._errHandler.sync(self)
_la = self._input.LA(1)
while (((_la) & ~0x3f) == 0 and ((1 << _la) & 2299087171663953952) != 0) or ((((_la - 86)) & ~0x3f) == 0 and ((1 << (_la - 86)) & 32575) != 0):
self.state = 442
localctx._block_item = self.block_item()
localctx.items.append(localctx._block_item)
self.state = 447
self._errHandler.sync(self)
_la = self._input.LA(1)
self.state = 448
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 = 452
self._errHandler.sync(self)
token = self._input.LA(1)
if token in [5, 21, 23, 25, 26, 27, 28, 29, 30, 31, 32, 35, 36, 53, 54, 55, 56, 57, 58, 59, 60, 94, 95, 96, 97, 98, 99, 100]:
self.enterOuterAlt(localctx, 1)
self.state = 450
self.statement()
pass
elif token in [20, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 86, 87, 88, 89, 90, 91]:
self.enterOuterAlt(localctx, 2)
self.state = 451
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 = 459
self._errHandler.sync(self)
token = self._input.LA(1)
if token in [20, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 86, 87, 88, 89, 90, 91]:
self.state = 454
localctx.start_decl = self.declaration()
pass
elif token in [8, 21, 35, 36, 53, 54, 55, 56, 57, 58, 59, 60, 94, 95, 96, 97, 98, 99, 100]:
self.state = 456
self._errHandler.sync(self)
_la = self._input.LA(1)
if (((_la) & ~0x3f) == 0 and ((1 << _la) & 2296835913040265216) != 0) or ((((_la - 94)) & ~0x3f) == 0 and ((1 << (_la - 94)) & 127) != 0):
self.state = 455
localctx.start_expr = self.expression(0)
self.state = 458
self.match(CoreDSL2Parser.T__7)
pass
else:
raise NoViableAltException(self)
self.state = 462
self._errHandler.sync(self)
_la = self._input.LA(1)
if (((_la) & ~0x3f) == 0 and ((1 << _la) & 2296835913040265216) != 0) or ((((_la - 94)) & ~0x3f) == 0 and ((1 << (_la - 94)) & 127) != 0):
self.state = 461
localctx.end_expr = self.expression(0)
self.state = 464
self.match(CoreDSL2Parser.T__7)
self.state = 473
self._errHandler.sync(self)
_la = self._input.LA(1)
if (((_la) & ~0x3f) == 0 and ((1 << _la) & 2296835913040265216) != 0) or ((((_la - 94)) & ~0x3f) == 0 and ((1 << (_la - 94)) & 127) != 0):
self.state = 465
localctx._expression = self.expression(0)
localctx.loop_exprs.append(localctx._expression)
self.state = 470
self._errHandler.sync(self)
_la = self._input.LA(1)
while _la==4:
self.state = 466
self.match(CoreDSL2Parser.T__3)
self.state = 467
localctx._expression = self.expression(0)
localctx.loop_exprs.append(localctx._expression)
self.state = 472
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 = 480
self._errHandler.sync(self)
_la = self._input.LA(1)
while _la==20 or _la==50 or ((((_la - 86)) & ~0x3f) == 0 and ((1 << (_la - 86)) & 15) != 0):
self.state = 478
self._errHandler.sync(self)
token = self._input.LA(1)
if token in [20, 88, 89]:
self.state = 475
localctx._storage_class_specifier = self.storage_class_specifier()
localctx.storage.append(localctx._storage_class_specifier)
pass
elif token in [86, 87]:
self.state = 476
localctx._type_qualifier = self.type_qualifier()
localctx.qualifiers.append(localctx._type_qualifier)
pass
elif token in [50]:
self.state = 477
localctx._attribute = self.attribute()
localctx.attributes.append(localctx._attribute)
pass
else:
raise NoViableAltException(self)
self.state = 482
self._errHandler.sync(self)
_la = self._input.LA(1)
self.state = 483
localctx.type_ = self.type_specifier()
self.state = 492
self._errHandler.sync(self)
_la = self._input.LA(1)
if _la==97:
self.state = 484
localctx._declarator = self.declarator()
localctx.declarations.append(localctx._declarator)
self.state = 489
self._errHandler.sync(self)
_la = self._input.LA(1)
while _la==4:
self.state = 485
self.match(CoreDSL2Parser.T__3)
self.state = 486
localctx._declarator = self.declarator()
localctx.declarations.append(localctx._declarator)
self.state = 491
self._errHandler.sync(self)
_la = self._input.LA(1)
self.state = 494
self.match(CoreDSL2Parser.T__7)
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 = 496
localctx.type_ = self.value_type_specifier()
self.state = 499
self._errHandler.sync(self)
token = self._input.LA(1)
if token in [35]:
self.state = 497
localctx.ptr = self.match(CoreDSL2Parser.T__34)
pass
elif token in [36]:
self.state = 498
localctx.ptr = self.match(CoreDSL2Parser.T__35)
pass
elif token in [4, 8, 22, 97]:
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 = 542
self._errHandler.sync(self)
la_ = self._interp.adaptivePredict(self._input,62,self._ctx)
if la_ == 1:
localctx = CoreDSL2Parser.Integer_typeContext(self, localctx)
self.enterOuterAlt(localctx, 1)
self.state = 501
localctx.signed = self.integer_signedness()
self.state = 507
self._errHandler.sync(self)
token = self._input.LA(1)
if token in [44, 45, 46, 47]:
self.state = 502
localctx.shorthand = self.integer_shorthand()
pass
elif token in [37]:
self.state = 503
self.match(CoreDSL2Parser.T__36)
self.state = 504
localctx.size = self.primary()
self.state = 505
self.match(CoreDSL2Parser.T__37)
pass
else:
raise NoViableAltException(self)
pass
elif la_ == 2:
localctx = CoreDSL2Parser.Integer_typeContext(self, localctx)
self.enterOuterAlt(localctx, 2)
self.state = 509
localctx.shorthand = self.integer_shorthand()
pass
elif la_ == 3:
localctx = CoreDSL2Parser.Float_typeContext(self, localctx)
self.enterOuterAlt(localctx, 3)
self.state = 510
localctx.shorthand = self.float_shorthand()
pass
elif la_ == 4:
localctx = CoreDSL2Parser.Bool_typeContext(self, localctx)
self.enterOuterAlt(localctx, 4)
self.state = 511
localctx.type_ = self.match(CoreDSL2Parser.T__38)
pass
elif la_ == 5:
localctx = CoreDSL2Parser.Void_typeContext(self, localctx)
self.enterOuterAlt(localctx, 5)
self.state = 512
localctx.type_ = self.match(CoreDSL2Parser.T__39)
pass
elif la_ == 6:
localctx = CoreDSL2Parser.Composite_declarationContext(self, localctx)
self.enterOuterAlt(localctx, 6)
self.state = 513
localctx.type_ = self.struct_or_union()
self.state = 515
self._errHandler.sync(self)
_la = self._input.LA(1)
if _la==97:
self.state = 514
localctx.name = self.match(CoreDSL2Parser.IDENTIFIER)
self.state = 517
self.match(CoreDSL2Parser.T__4)
self.state = 521
self._errHandler.sync(self)
_la = self._input.LA(1)
while ((((_la - 39)) & ~0x3f) == 0 and ((1 << (_la - 39)) & 7177611906123775) != 0):
self.state = 518
localctx._struct_declaration = self.struct_declaration()
localctx.declarations.append(localctx._struct_declaration)
self.state = 523
self._errHandler.sync(self)
_la = self._input.LA(1)
self.state = 524
self.match(CoreDSL2Parser.T__5)
pass
elif la_ == 7:
localctx = CoreDSL2Parser.Composite_referenceContext(self, localctx)
self.enterOuterAlt(localctx, 7)
self.state = 526
localctx.type_ = self.struct_or_union()
self.state = 527
localctx.name = self.match(CoreDSL2Parser.IDENTIFIER)
pass
elif la_ == 8:
localctx = CoreDSL2Parser.Enum_declarationContext(self, localctx)
self.enterOuterAlt(localctx, 8)
self.state = 529
localctx.type_ = self.match(CoreDSL2Parser.T__40)
self.state = 531
self._errHandler.sync(self)
_la = self._input.LA(1)
if _la==97:
self.state = 530
localctx.name = self.match(CoreDSL2Parser.IDENTIFIER)
self.state = 533
self.match(CoreDSL2Parser.T__4)
self.state = 534
self.enumerator_list()
self.state = 536
self._errHandler.sync(self)
_la = self._input.LA(1)
if _la==4:
self.state = 535
self.match(CoreDSL2Parser.T__3)
self.state = 538
self.match(CoreDSL2Parser.T__5)
pass
elif la_ == 9:
localctx = CoreDSL2Parser.Enum_referenceContext(self, localctx)
self.enterOuterAlt(localctx, 9)
self.state = 540
localctx.type_ = self.match(CoreDSL2Parser.T__40)
self.state = 541
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 = 544
_la = self._input.LA(1)
if not(_la==42 or _la==43):
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 = 546
_la = self._input.LA(1)
if not((((_la) & ~0x3f) == 0 and ((1 << _la) & 263882790666240) != 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 = 548
_la = self._input.LA(1)
if not(_la==48 or _la==49):
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 = 550
self.match(CoreDSL2Parser.T__49)
self.state = 551
localctx.name = self.match(CoreDSL2Parser.IDENTIFIER)
self.state = 565
self._errHandler.sync(self)
token = self._input.LA(1)
if token in [51]:
self.state = 552
self.match(CoreDSL2Parser.T__50)
self.state = 553
localctx._expression = self.expression(0)
localctx.params.append(localctx._expression)
pass
elif token in [21]:
self.state = 554
self.match(CoreDSL2Parser.T__20)
self.state = 555
localctx._expression = self.expression(0)
localctx.params.append(localctx._expression)
self.state = 560
self._errHandler.sync(self)
_la = self._input.LA(1)
while _la==4:
self.state = 556
self.match(CoreDSL2Parser.T__3)
self.state = 557
localctx._expression = self.expression(0)
localctx.params.append(localctx._expression)
self.state = 562
self._errHandler.sync(self)
_la = self._input.LA(1)
self.state = 563
self.match(CoreDSL2Parser.T__21)
pass
elif token in [52]:
pass
else:
pass
self.state = 567
self.match(CoreDSL2Parser.T__51)
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 = 569
self.match(CoreDSL2Parser.T__36)
self.state = 570
localctx._primary = self.primary()
localctx.size.append(localctx._primary)
self.state = 578
self._errHandler.sync(self)
_la = self._input.LA(1)
if _la==4:
self.state = 571
self.match(CoreDSL2Parser.T__3)
self.state = 572
localctx._primary = self.primary()
localctx.size.append(localctx._primary)
self.state = 573
self.match(CoreDSL2Parser.T__3)
self.state = 574
localctx._primary = self.primary()
localctx.size.append(localctx._primary)
self.state = 575
self.match(CoreDSL2Parser.T__3)
self.state = 576
localctx._primary = self.primary()
localctx.size.append(localctx._primary)
self.state = 580
self.match(CoreDSL2Parser.T__37)
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 = 582
localctx._enumerator = self.enumerator()
localctx.enumerators.append(localctx._enumerator)
self.state = 587
self._errHandler.sync(self)
_alt = self._interp.adaptivePredict(self._input,66,self._ctx)
while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
if _alt==1:
self.state = 583
self.match(CoreDSL2Parser.T__3)
self.state = 584
localctx._enumerator = self.enumerator()
localctx.enumerators.append(localctx._enumerator)
self.state = 589
self._errHandler.sync(self)
_alt = self._interp.adaptivePredict(self._input,66,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 = 594
self._errHandler.sync(self)
la_ = self._interp.adaptivePredict(self._input,67,self._ctx)
if la_ == 1:
self.enterOuterAlt(localctx, 1)
self.state = 590
localctx.name = self.match(CoreDSL2Parser.IDENTIFIER)
pass
elif la_ == 2:
self.enterOuterAlt(localctx, 2)
self.state = 591
localctx.name = self.match(CoreDSL2Parser.IDENTIFIER)
self.state = 592
self.match(CoreDSL2Parser.T__50)
self.state = 593
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 = 596
localctx.specifier = self.struct_declaration_specifier()
self.state = 597
localctx._declarator = self.declarator()
localctx.declarators.append(localctx._declarator)
self.state = 602
self._errHandler.sync(self)
_la = self._input.LA(1)
while _la==4:
self.state = 598
self.match(CoreDSL2Parser.T__3)
self.state = 599
localctx._declarator = self.declarator()
localctx.declarators.append(localctx._declarator)
self.state = 604
self._errHandler.sync(self)
_la = self._input.LA(1)
self.state = 605
self.match(CoreDSL2Parser.T__7)
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 = 609
self._errHandler.sync(self)
token = self._input.LA(1)
if token in [39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 90, 91]:
self.enterOuterAlt(localctx, 1)
self.state = 607
localctx.type_ = self.type_specifier()
pass
elif token in [86, 87]:
self.enterOuterAlt(localctx, 2)
self.state = 608
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 = 611
localctx.name = self.match(CoreDSL2Parser.IDENTIFIER)
self.state = 618
self._errHandler.sync(self)
_la = self._input.LA(1)
while _la==92:
self.state = 612
self.match(CoreDSL2Parser.LEFT_BR)
self.state = 613
localctx._expression = self.expression(0)
localctx.size.append(localctx._expression)
self.state = 614
self.match(CoreDSL2Parser.RIGHT_BR)
self.state = 620
self._errHandler.sync(self)
_la = self._input.LA(1)
self.state = 624
self._errHandler.sync(self)
_la = self._input.LA(1)
while _la==50:
self.state = 621
localctx._attribute = self.attribute()
localctx.attributes.append(localctx._attribute)
self.state = 626
self._errHandler.sync(self)
_la = self._input.LA(1)
self.state = 629
self._errHandler.sync(self)
_la = self._input.LA(1)
if _la==51:
self.state = 627
self.match(CoreDSL2Parser.T__50)
self.state = 628
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 = 639
self._errHandler.sync(self)
token = self._input.LA(1)
if token in [21, 35, 36, 53, 54, 55, 56, 57, 58, 59, 60, 94, 95, 96, 97, 98, 99, 100]:
self.enterOuterAlt(localctx, 1)
self.state = 631
localctx.expr = self.expression(0)
pass
elif token in [5]:
self.enterOuterAlt(localctx, 2)
self.state = 632
self.match(CoreDSL2Parser.T__4)
self.state = 633
self.initializerList()
self.state = 635
self._errHandler.sync(self)
_la = self._input.LA(1)
if _la==4:
self.state = 634
self.match(CoreDSL2Parser.T__3)
self.state = 637
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 = 643
self._errHandler.sync(self)
la_ = self._interp.adaptivePredict(self._input,75,self._ctx)
if la_ == 1:
self.state = 641
self.designated_initializer()
pass
elif la_ == 2:
self.state = 642
self.initializer()
pass
self.state = 652
self._errHandler.sync(self)
_alt = self._interp.adaptivePredict(self._input,77,self._ctx)
while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
if _alt==1:
self.state = 645
self.match(CoreDSL2Parser.T__3)
self.state = 648
self._errHandler.sync(self)
la_ = self._interp.adaptivePredict(self._input,76,self._ctx)
if la_ == 1:
self.state = 646
self.designated_initializer()
pass
elif la_ == 2:
self.state = 647
self.initializer()
pass
self.state = 654
self._errHandler.sync(self)
_alt = self._interp.adaptivePredict(self._input,77,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 = 656
self._errHandler.sync(self)
_la = self._input.LA(1)
while True:
self.state = 655
localctx._designator = self.designator()
localctx.designators.append(localctx._designator)
self.state = 658
self._errHandler.sync(self)
_la = self._input.LA(1)
if not (_la==53 or _la==92):
break
self.state = 660
self.match(CoreDSL2Parser.T__50)
self.state = 661
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 = 669
self._errHandler.sync(self)
token = self._input.LA(1)
if token in [92]:
self.enterOuterAlt(localctx, 1)
self.state = 663
self.match(CoreDSL2Parser.LEFT_BR)
self.state = 664
localctx.idx = self.expression(0)
self.state = 665
self.match(CoreDSL2Parser.RIGHT_BR)
pass
elif token in [53]:
self.enterOuterAlt(localctx, 2)
self.state = 667
self.match(CoreDSL2Parser.T__52)
self.state = 668
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 = 702
self._errHandler.sync(self)
la_ = self._interp.adaptivePredict(self._input,83,self._ctx)
if la_ == 1:
localctx = CoreDSL2Parser.Primary_expressionContext(self, localctx)
self._ctx = localctx
_prevctx = localctx
self.state = 672
self.primary()
pass
elif la_ == 2:
localctx = CoreDSL2Parser.Deref_expressionContext(self, localctx)
self._ctx = localctx
_prevctx = localctx
self.state = 673
localctx.bop = self._input.LT(1)
_la = self._input.LA(1)
if not(_la==53 or _la==54):
localctx.bop = self._errHandler.recoverInline(self)
else:
self._errHandler.reportMatch(self)
self.consume()
self.state = 674
localctx.ref = self.match(CoreDSL2Parser.IDENTIFIER)
pass
elif la_ == 3:
localctx = CoreDSL2Parser.Method_callContext(self, localctx)
self._ctx = localctx
_prevctx = localctx
self.state = 675
localctx.ref = self.match(CoreDSL2Parser.IDENTIFIER)
self.state = 676
self.match(CoreDSL2Parser.T__20)
self.state = 685
self._errHandler.sync(self)
_la = self._input.LA(1)
if (((_la) & ~0x3f) == 0 and ((1 << _la) & 2296835913040265216) != 0) or ((((_la - 94)) & ~0x3f) == 0 and ((1 << (_la - 94)) & 127) != 0):
self.state = 677
localctx._expression = self.expression(0)
localctx.args.append(localctx._expression)
self.state = 682
self._errHandler.sync(self)
_la = self._input.LA(1)
while _la==4:
self.state = 678
self.match(CoreDSL2Parser.T__3)
self.state = 679
localctx._expression = self.expression(0)
localctx.args.append(localctx._expression)
self.state = 684
self._errHandler.sync(self)
_la = self._input.LA(1)
self.state = 687
self.match(CoreDSL2Parser.T__21)
pass
elif la_ == 4:
localctx = CoreDSL2Parser.Preinc_expressionContext(self, localctx)
self._ctx = localctx
_prevctx = localctx
self.state = 688
localctx.op = self._input.LT(1)
_la = self._input.LA(1)
if not(_la==55 or _la==56):
localctx.op = self._errHandler.recoverInline(self)
else:
self._errHandler.reportMatch(self)
self.consume()
self.state = 689
localctx.right = self.expression(17)
pass
elif la_ == 5:
localctx = CoreDSL2Parser.Prefix_expressionContext(self, localctx)
self._ctx = localctx
_prevctx = localctx
self.state = 690
localctx.prefix = self._input.LT(1)
_la = self._input.LA(1)
if not((((_la) & ~0x3f) == 0 and ((1 << _la) & 432345667306782720) != 0)):
localctx.prefix = self._errHandler.recoverInline(self)
else:
self._errHandler.reportMatch(self)
self.consume()
self.state = 691
localctx.right = self.expression(16)
pass
elif la_ == 6:
localctx = CoreDSL2Parser.Prefix_expressionContext(self, localctx)
self._ctx = localctx
_prevctx = localctx
self.state = 692
localctx.prefix = self._input.LT(1)
_la = self._input.LA(1)
if not(_la==59 or _la==60):
localctx.prefix = self._errHandler.recoverInline(self)
else:
self._errHandler.reportMatch(self)
self.consume()
self.state = 693
localctx.right = self.expression(15)
pass
elif la_ == 7:
localctx = CoreDSL2Parser.Cast_expressionContext(self, localctx)
self._ctx = localctx
_prevctx = localctx
self.state = 694
self.match(CoreDSL2Parser.T__20)
self.state = 697
self._errHandler.sync(self)
la_ = self._interp.adaptivePredict(self._input,82,self._ctx)
if la_ == 1:
self.state = 695
localctx.type_ = self.type_specifier()
pass
elif la_ == 2:
self.state = 696
localctx.sign = self.integer_signedness()
pass
self.state = 699
self.match(CoreDSL2Parser.T__21)
self.state = 700
localctx.right = self.expression(14)
pass
self._ctx.stop = self._input.LT(-1)
self.state = 759
self._errHandler.sync(self)
_alt = self._interp.adaptivePredict(self._input,86,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 = 757
self._errHandler.sync(self)
la_ = self._interp.adaptivePredict(self._input,85,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 = 704
if not self.precpred(self._ctx, 13):
from antlr4.error.Errors import FailedPredicateException
raise FailedPredicateException(self, "self.precpred(self._ctx, 13)")
self.state = 705
localctx.bop = self._input.LT(1)
_la = self._input.LA(1)
if not((((_la) & ~0x3f) == 0 and ((1 << _la) & 6917529062000820224) != 0)):
localctx.bop = self._errHandler.recoverInline(self)
else:
self._errHandler.reportMatch(self)
self.consume()
self.state = 706
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 = 707
if not self.precpred(self._ctx, 12):
from antlr4.error.Errors import FailedPredicateException
raise FailedPredicateException(self, "self.precpred(self._ctx, 12)")
self.state = 708
localctx.bop = self._input.LT(1)
_la = self._input.LA(1)
if not(_la==57 or _la==58):
localctx.bop = self._errHandler.recoverInline(self)
else:
self._errHandler.reportMatch(self)
self.consume()
self.state = 709
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 = 710
if not self.precpred(self._ctx, 11):
from antlr4.error.Errors import FailedPredicateException
raise FailedPredicateException(self, "self.precpred(self._ctx, 11)")
self.state = 711
localctx.bop = self._input.LT(1)
_la = self._input.LA(1)
if not(_la==63 or _la==64):
localctx.bop = self._errHandler.recoverInline(self)
else:
self._errHandler.reportMatch(self)
self.consume()
self.state = 712
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 = 713
if not self.precpred(self._ctx, 10):
from antlr4.error.Errors import FailedPredicateException
raise FailedPredicateException(self, "self.precpred(self._ctx, 10)")
self.state = 714
localctx.bop = self._input.LT(1)
_la = self._input.LA(1)
if not(((((_la - 37)) & ~0x3f) == 0 and ((1 << (_la - 37)) & 805306371) != 0)):
localctx.bop = self._errHandler.recoverInline(self)
else:
self._errHandler.reportMatch(self)
self.consume()
self.state = 715
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 = 716
if not self.precpred(self._ctx, 9):
from antlr4.error.Errors import FailedPredicateException
raise FailedPredicateException(self, "self.precpred(self._ctx, 9)")
self.state = 717
localctx.bop = self._input.LT(1)
_la = self._input.LA(1)
if not(_la==67 or _la==68):
localctx.bop = self._errHandler.recoverInline(self)
else:
self._errHandler.reportMatch(self)
self.consume()
self.state = 718
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 = 719
if not self.precpred(self._ctx, 8):
from antlr4.error.Errors import FailedPredicateException
raise FailedPredicateException(self, "self.precpred(self._ctx, 8)")
self.state = 720
localctx.bop = self.match(CoreDSL2Parser.T__35)
self.state = 721
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 = 722
if not self.precpred(self._ctx, 7):
from antlr4.error.Errors import FailedPredicateException
raise FailedPredicateException(self, "self.precpred(self._ctx, 7)")
self.state = 723
localctx.bop = self.match(CoreDSL2Parser.T__68)
self.state = 724
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 = 725
if not self.precpred(self._ctx, 6):
from antlr4.error.Errors import FailedPredicateException
raise FailedPredicateException(self, "self.precpred(self._ctx, 6)")
self.state = 726
localctx.bop = self.match(CoreDSL2Parser.T__69)
self.state = 727
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 = 728
if not self.precpred(self._ctx, 5):
from antlr4.error.Errors import FailedPredicateException
raise FailedPredicateException(self, "self.precpred(self._ctx, 5)")
self.state = 729
localctx.bop = self.match(CoreDSL2Parser.T__70)
self.state = 730
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 = 731
if not self.precpred(self._ctx, 4):
from antlr4.error.Errors import FailedPredicateException
raise FailedPredicateException(self, "self.precpred(self._ctx, 4)")
self.state = 732
localctx.bop = self.match(CoreDSL2Parser.T__71)
self.state = 733
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 = 734
if not self.precpred(self._ctx, 3):
from antlr4.error.Errors import FailedPredicateException
raise FailedPredicateException(self, "self.precpred(self._ctx, 3)")
self.state = 735
localctx.bop = self.match(CoreDSL2Parser.T__16)
self.state = 736
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 = 737
if not self.precpred(self._ctx, 2):
from antlr4.error.Errors import FailedPredicateException
raise FailedPredicateException(self, "self.precpred(self._ctx, 2)")
self.state = 738
localctx.bop = self.match(CoreDSL2Parser.T__72)
self.state = 739
localctx.then_expr = self.expression(0)
self.state = 740
self.match(CoreDSL2Parser.T__15)
self.state = 741
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 = 743
if not self.precpred(self._ctx, 1):
from antlr4.error.Errors import FailedPredicateException
raise FailedPredicateException(self, "self.precpred(self._ctx, 1)")
self.state = 744
localctx.bop = self._input.LT(1)
_la = self._input.LA(1)
if not(((((_la - 51)) & ~0x3f) == 0 and ((1 << (_la - 51)) & 17171480577) != 0)):
localctx.bop = self._errHandler.recoverInline(self)
else:
self._errHandler.reportMatch(self)
self.consume()
self.state = 745
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 = 746
if not self.precpred(self._ctx, 20):
from antlr4.error.Errors import FailedPredicateException
raise FailedPredicateException(self, "self.precpred(self._ctx, 20)")
self.state = 747
localctx.bop = self.match(CoreDSL2Parser.LEFT_BR)
self.state = 748
localctx.left = self.expression(0)
self.state = 751
self._errHandler.sync(self)
_la = self._input.LA(1)
if _la==16:
self.state = 749
self.match(CoreDSL2Parser.T__15)
self.state = 750
localctx.right = self.expression(0)
self.state = 753
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 = 755
if not self.precpred(self._ctx, 18):
from antlr4.error.Errors import FailedPredicateException
raise FailedPredicateException(self, "self.precpred(self._ctx, 18)")
self.state = 756
localctx.op = self._input.LT(1)
_la = self._input.LA(1)
if not(_la==55 or _la==56):
localctx.op = self._errHandler.recoverInline(self)
else:
self._errHandler.reportMatch(self)
self.consume()
pass
self.state = 761
self._errHandler.sync(self)
_alt = self._interp.adaptivePredict(self._input,86,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 = 773
self._errHandler.sync(self)
la_ = self._interp.adaptivePredict(self._input,88,self._ctx)
if la_ == 1:
localctx = CoreDSL2Parser.Reference_expressionContext(self, localctx)
self.enterOuterAlt(localctx, 1)
self.state = 762
localctx.ref = self.match(CoreDSL2Parser.IDENTIFIER)
pass
elif la_ == 2:
localctx = CoreDSL2Parser.Constant_expressionContext(self, localctx)
self.enterOuterAlt(localctx, 2)
self.state = 763
localctx.const_expr = self.constant()
pass
elif la_ == 3:
localctx = CoreDSL2Parser.Literal_expressionContext(self, localctx)
self.enterOuterAlt(localctx, 3)
self.state = 765
self._errHandler.sync(self)
_alt = 1
while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
if _alt == 1:
self.state = 764
localctx._string_literal = self.string_literal()
localctx.literal.append(localctx._string_literal)
else:
raise NoViableAltException(self)
self.state = 767
self._errHandler.sync(self)
_alt = self._interp.adaptivePredict(self._input,87,self._ctx)
pass
elif la_ == 4:
localctx = CoreDSL2Parser.Parens_expressionContext(self, localctx)
self.enterOuterAlt(localctx, 4)
self.state = 769
self.match(CoreDSL2Parser.T__20)
self.state = 770
localctx.expr = self.expression(0)
self.state = 771
self.match(CoreDSL2Parser.T__21)
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 = 775
_la = self._input.LA(1)
if not(_la==99 or _la==100):
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 = 782
self._errHandler.sync(self)
token = self._input.LA(1)
if token in [96]:
self.enterOuterAlt(localctx, 1)
self.state = 777
self.integer_constant()
pass
elif token in [95]:
self.enterOuterAlt(localctx, 2)
self.state = 778
self.floating_constant()
pass
elif token in [98]:
self.enterOuterAlt(localctx, 3)
self.state = 779
self.character_constant()
pass
elif token in [100]:
self.enterOuterAlt(localctx, 4)
self.state = 780
self.string_constant()
pass
elif token in [94]:
self.enterOuterAlt(localctx, 5)
self.state = 781
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 = 784
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 = 786
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 = 788
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 = 790
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 = 792
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 = 794
self.match(CoreDSL2Parser.LEFT_BR)
self.state = 795
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 = 797
self.match(CoreDSL2Parser.RIGHT_BR)
self.state = 798
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 = 800
_la = self._input.LA(1)
if not(((((_la - 39)) & ~0x3f) == 0 and ((1 << (_la - 39)) & 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 = 802
_la = self._input.LA(1)
if not(_la==86 or _la==87):
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 = 804
_la = self._input.LA(1)
if not(_la==20 or _la==88 or _la==89):
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 = 806
_la = self._input.LA(1)
if not(_la==90 or _la==91):
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)