1 module dud.sdlang.ast; 2 3 import dud.sdlang.tokenmodule; 4 5 import dud.sdlang.visitor; 6 7 @safe pure: 8 9 class Node {} 10 11 enum RootEnum { 12 T, 13 TT, 14 E, 15 } 16 17 class Root : Node { 18 @safe pure: 19 20 RootEnum ruleSelection; 21 Tags tags; 22 23 this(RootEnum ruleSelection, Tags tags) { 24 this.ruleSelection = ruleSelection; 25 this.tags = tags; 26 } 27 28 this(RootEnum ruleSelection) { 29 this.ruleSelection = ruleSelection; 30 } 31 32 void visit(Visitor vis) { 33 vis.accept(this); 34 } 35 36 void visit(Visitor vis) const { 37 vis.accept(this); 38 } 39 40 void visit(ConstVisitor vis) { 41 vis.accept(this); 42 } 43 44 void visit(ConstVisitor vis) const { 45 vis.accept(this); 46 } 47 } 48 49 enum TagsEnum { 50 Tag, 51 TagFollow, 52 } 53 54 class Tags : Node { 55 @safe pure: 56 57 TagsEnum ruleSelection; 58 Tags follow; 59 Tag cur; 60 61 this(TagsEnum ruleSelection, Tag cur) { 62 this.ruleSelection = ruleSelection; 63 this.cur = cur; 64 } 65 66 this(TagsEnum ruleSelection, Tag cur, Tags follow) { 67 this.ruleSelection = ruleSelection; 68 this.cur = cur; 69 this.follow = follow; 70 } 71 72 void visit(Visitor vis) { 73 vis.accept(this); 74 } 75 76 void visit(Visitor vis) const { 77 vis.accept(this); 78 } 79 80 void visit(ConstVisitor vis) { 81 vis.accept(this); 82 } 83 84 void visit(ConstVisitor vis) const { 85 vis.accept(this); 86 } 87 } 88 89 enum TagEnum { 90 IVAO, 91 IAO, 92 IVO, 93 IVA, 94 IO, 95 IA, 96 IV, 97 IE, 98 IVAOT, 99 IAOT, 100 IVOT, 101 IVAT, 102 IOT, 103 IAT, 104 IVT, 105 IET, 106 VAO, 107 VO, 108 VA, 109 O, 110 V, 111 VAOT, 112 VOT, 113 VAT, 114 OT, 115 VT, 116 } 117 118 class Tag : Node { 119 @safe pure: 120 121 TagEnum ruleSelection; 122 OptChild oc; 123 IDFull id; 124 Values vals; 125 Attributes attrs; 126 127 this(TagEnum ruleSelection, IDFull id, Values vals, Attributes attrs, OptChild oc) { 128 this.ruleSelection = ruleSelection; 129 this.id = id; 130 this.vals = vals; 131 this.attrs = attrs; 132 this.oc = oc; 133 } 134 135 this(TagEnum ruleSelection, IDFull id, Attributes attrs, OptChild oc) { 136 this.ruleSelection = ruleSelection; 137 this.id = id; 138 this.attrs = attrs; 139 this.oc = oc; 140 } 141 142 this(TagEnum ruleSelection, IDFull id, Values vals, OptChild oc) { 143 this.ruleSelection = ruleSelection; 144 this.id = id; 145 this.vals = vals; 146 this.oc = oc; 147 } 148 149 this(TagEnum ruleSelection, IDFull id, Values vals, Attributes attrs) { 150 this.ruleSelection = ruleSelection; 151 this.id = id; 152 this.vals = vals; 153 this.attrs = attrs; 154 } 155 156 this(TagEnum ruleSelection, IDFull id, OptChild oc) { 157 this.ruleSelection = ruleSelection; 158 this.id = id; 159 this.oc = oc; 160 } 161 162 this(TagEnum ruleSelection, IDFull id, Attributes attrs) { 163 this.ruleSelection = ruleSelection; 164 this.id = id; 165 this.attrs = attrs; 166 } 167 168 this(TagEnum ruleSelection, IDFull id, Values vals) { 169 this.ruleSelection = ruleSelection; 170 this.id = id; 171 this.vals = vals; 172 } 173 174 this(TagEnum ruleSelection, IDFull id) { 175 this.ruleSelection = ruleSelection; 176 this.id = id; 177 } 178 179 this(TagEnum ruleSelection, Values vals, Attributes attrs, OptChild oc) { 180 this.ruleSelection = ruleSelection; 181 this.vals = vals; 182 this.attrs = attrs; 183 this.oc = oc; 184 } 185 186 this(TagEnum ruleSelection, Values vals, OptChild oc) { 187 this.ruleSelection = ruleSelection; 188 this.vals = vals; 189 this.oc = oc; 190 } 191 192 this(TagEnum ruleSelection, Values vals, Attributes attrs) { 193 this.ruleSelection = ruleSelection; 194 this.vals = vals; 195 this.attrs = attrs; 196 } 197 198 this(TagEnum ruleSelection, OptChild oc) { 199 this.ruleSelection = ruleSelection; 200 this.oc = oc; 201 } 202 203 this(TagEnum ruleSelection, Values vals) { 204 this.ruleSelection = ruleSelection; 205 this.vals = vals; 206 } 207 208 void visit(Visitor vis) { 209 vis.accept(this); 210 } 211 212 void visit(Visitor vis) const { 213 vis.accept(this); 214 } 215 216 void visit(ConstVisitor vis) { 217 vis.accept(this); 218 } 219 220 void visit(ConstVisitor vis) const { 221 vis.accept(this); 222 } 223 } 224 225 enum IDFullEnum { 226 S, 227 L, 228 } 229 230 class IDFull : Node { 231 @safe pure: 232 233 IDFullEnum ruleSelection; 234 IDFull follow; 235 Token cur; 236 237 this(IDFullEnum ruleSelection, Token cur) { 238 this.ruleSelection = ruleSelection; 239 this.cur = cur; 240 } 241 242 this(IDFullEnum ruleSelection, Token cur, IDFull follow) { 243 this.ruleSelection = ruleSelection; 244 this.cur = cur; 245 this.follow = follow; 246 } 247 248 void visit(Visitor vis) { 249 vis.accept(this); 250 } 251 252 void visit(Visitor vis) const { 253 vis.accept(this); 254 } 255 256 void visit(ConstVisitor vis) { 257 vis.accept(this); 258 } 259 260 void visit(ConstVisitor vis) const { 261 vis.accept(this); 262 } 263 } 264 265 enum ValuesEnum { 266 Value, 267 ValueFollow, 268 } 269 270 class Values : Node { 271 @safe pure: 272 273 ValuesEnum ruleSelection; 274 Values follow; 275 Token cur; 276 277 this(ValuesEnum ruleSelection, Token cur) { 278 this.ruleSelection = ruleSelection; 279 this.cur = cur; 280 } 281 282 this(ValuesEnum ruleSelection, Token cur, Values follow) { 283 this.ruleSelection = ruleSelection; 284 this.cur = cur; 285 this.follow = follow; 286 } 287 288 void visit(Visitor vis) { 289 vis.accept(this); 290 } 291 292 void visit(Visitor vis) const { 293 vis.accept(this); 294 } 295 296 void visit(ConstVisitor vis) { 297 vis.accept(this); 298 } 299 300 void visit(ConstVisitor vis) const { 301 vis.accept(this); 302 } 303 } 304 305 enum AttributesEnum { 306 Attribute, 307 AttributeFollow, 308 } 309 310 class Attributes : Node { 311 @safe pure: 312 313 AttributesEnum ruleSelection; 314 Attributes follow; 315 Attribute cur; 316 317 this(AttributesEnum ruleSelection, Attribute cur) { 318 this.ruleSelection = ruleSelection; 319 this.cur = cur; 320 } 321 322 this(AttributesEnum ruleSelection, Attribute cur, Attributes follow) { 323 this.ruleSelection = ruleSelection; 324 this.cur = cur; 325 this.follow = follow; 326 } 327 328 void visit(Visitor vis) { 329 vis.accept(this); 330 } 331 332 void visit(Visitor vis) const { 333 vis.accept(this); 334 } 335 336 void visit(ConstVisitor vis) { 337 vis.accept(this); 338 } 339 340 void visit(ConstVisitor vis) const { 341 vis.accept(this); 342 } 343 } 344 345 enum AttributeEnum { 346 A, 347 } 348 349 class Attribute : Node { 350 @safe pure: 351 352 AttributeEnum ruleSelection; 353 Token value; 354 IDFull id; 355 356 this(AttributeEnum ruleSelection, IDFull id, Token value) { 357 this.ruleSelection = ruleSelection; 358 this.id = id; 359 this.value = value; 360 } 361 362 void visit(Visitor vis) { 363 vis.accept(this); 364 } 365 366 void visit(Visitor vis) const { 367 vis.accept(this); 368 } 369 370 void visit(ConstVisitor vis) { 371 vis.accept(this); 372 } 373 374 void visit(ConstVisitor vis) const { 375 vis.accept(this); 376 } 377 } 378 379 enum OptChildEnum { 380 T, 381 E, 382 E2, 383 } 384 385 class OptChild : Node { 386 @safe pure: 387 388 OptChildEnum ruleSelection; 389 Tags tags; 390 391 this(OptChildEnum ruleSelection, Tags tags) { 392 this.ruleSelection = ruleSelection; 393 this.tags = tags; 394 } 395 396 this(OptChildEnum ruleSelection) { 397 this.ruleSelection = ruleSelection; 398 } 399 400 void visit(Visitor vis) { 401 vis.accept(this); 402 } 403 404 void visit(Visitor vis) const { 405 vis.accept(this); 406 } 407 408 void visit(ConstVisitor vis) { 409 vis.accept(this); 410 } 411 412 void visit(ConstVisitor vis) const { 413 vis.accept(this); 414 } 415 } 416 417 enum TagTerminatorEnum { 418 E, 419 S, 420 EF, 421 SF, 422 } 423 424 class TagTerminator : Node { 425 @safe pure: 426 427 TagTerminatorEnum ruleSelection; 428 429 this(TagTerminatorEnum ruleSelection) { 430 this.ruleSelection = ruleSelection; 431 } 432 433 void visit(Visitor vis) { 434 vis.accept(this); 435 } 436 437 void visit(Visitor vis) const { 438 vis.accept(this); 439 } 440 441 void visit(ConstVisitor vis) { 442 vis.accept(this); 443 } 444 445 void visit(ConstVisitor vis) const { 446 vis.accept(this); 447 } 448 } 449