hoshi-lang dev
Yet another programming language
Loading...
Searching...
No Matches
ast.cpp
Go to the documentation of this file.
1//
2// Created by XIaokang00010 on 2023/1/24.
3//
4
5#include "ast.hpp"
6
7namespace yoi {
9 return node;
10 }
11
13 return node;
14 }
15
17 return *id;
18 }
19
21 return *spec;
22 }
23
25 return *id;
26 }
30
32 return *spec;
33 }
34
38
42
46
50
52 return *resultType;
53 }
54
58
60 return *func;
61 }
62
64 return *expr;
65 }
66
68 return *id;
69 }
70
74
76 return arg;
77 }
78
82
86
90
92 return id;
93 }
94
98
100 return *member;
101 }
102
104 return *literals;
105 }
106
108 return *expr;
109 }
110
112 return op;
113 }
114
116 return *lhs;
117 }
118
119 uniqueExpr::operator bool() const {
120 return op.kind != lexer::token::tokenKind::unknown;
121 }
122
124 return op;
125 }
126
128 return *lhs;
129 }
130
132 return *rhs;
133 }
134
135 bool leftExpr::hasRhs() const {
136 return rhs != nullptr;
137 }
138
142
144 return ops;
145 }
146
147 mulExpr::operator bool() const {
148 return !ops.empty();
149 }
150
152 return terms;
153 }
154
156 return ops;
157 }
158
159 addExpr::operator bool() const {
160 return !ops.empty();
161 }
162
166
168 return ops;
169 }
170
171 shiftExpr::operator bool() const {
172 return !ops.empty();
173 }
174
178
182
183 relationalExpr::operator bool() const {
184 return !ops.empty();
185 }
186
190
194
195 equalityExpr::operator bool() const {
196 return !ops.empty();
197 }
198
202
204 return ops;
205 }
206
207 andExpr::operator bool() const {
208 return !ops.empty();
209 }
210
214
218
219 exclusiveExpr::operator bool() const {
220 return !ops.empty();
221 }
222
226
230
231 inclusiveExpr::operator bool() const {
232 return !ops.empty();
233 }
234
238
242
243 logicalAndExpr::operator bool() const {
244 return !ops.empty();
245 }
246
250
254
255 logicalOrExpr::operator bool() const {
256 return !ops.empty();
257 }
258
260 return *expr;
261 }
262
264 return *name;
265 }
266
268 return path;
269 }
270
274
278
282
284 return *block;
285 }
286
290
292 return !var;
293 }
294
298
302
306
310
314
318
322
326
330
334
336 return *id;
337 }
338
342
346
350
352 return con;
353 }
354
358
362
366
368 return interfaceName;
369 }
370
372 return *inner;
373 }
374
378
380 return *rhs;
381 }
382
386
390
394
396 return *cond;
397 }
398
400 return *block;
401 }
402
404 return ifB;
405 }
406
410
412 return *elseB;
413 }
414
415 bool ifStmt::hasElseBlock() const {
416 return elseB;
417 }
418
420 return *cond;
421 }
422
424 return *block;
425 }
426
428 return *initStmt;
429 }
430
432 return *cond;
433 }
434
436 return *afterStmt;
437 }
438
440 return *block;
441 }
442
444 return *var;
445 }
446
448 return *container;
449 }
450
452 return *block;
453 }
454
456 return *value;
457 }
458
459 bool returnStmt::hasValue() const {
460 return value;
461 }
462
466
470
472 return stmts;
473 }
474
476 finalizeAST(ptr->args);
478 delete ptr;
479 }
480
482 for (auto &i : ptr->get())
483 finalizeAST(i);
484 delete ptr;
485 }
486
488 for (auto &i : ptr->get())
489 finalizeAST(i);
490 delete ptr;
491 }
492
494 for (auto &i : ptr->get())
495 finalizeAST(i);
496 delete ptr;
497 }
498
500 finalizeAST(ptr->spec);
501 delete ptr;
502 }
503
505 for (auto &i : ptr->get())
506 finalizeAST(i);
507 delete ptr;
508 }
509
511 finalizeAST(ptr->id);
512 if (ptr->satisfyCondition)
514 delete ptr;
515 }
516
518 finalizeAST(ptr->id);
519 finalizeAST(ptr->spec);
520 delete ptr;
521 }
522
524 switch (ptr->kind) {
526 finalizeAST(ptr->member);
527 break;
529 finalizeAST(ptr->func);
530 break;
533 break;
536 break;
537 }
538
539 delete ptr->arraySubscript;
540 delete ptr;
541 }
542
544 delete ptr;
545 }
546
548 delete ptr;
549 }
550
552 finalizeAST(ptr->id);
553 if (ptr->hasDefTemplateArg())
554 finalizeAST(ptr->arg);
555 delete ptr;
556 }
557
559 finalizeAST(ptr->id);
560 if (ptr->hasTemplateArg())
561 finalizeAST(ptr->arg);
562 delete ptr;
563 }
564
566 finalizeAST(ptr->id);
567 for (auto &i : ptr->subscriptVal)
568 finalizeAST(i);
569 delete ptr;
570 }
571
573 for (auto &i : ptr->getTerms())
574 finalizeAST(i);
575 }
576
577 void finalizeAST(primary *ptr) {
578 switch (ptr->kind) {
580 finalizeAST(ptr->member);
581 break;
583 finalizeAST(ptr->literals);
584 break;
586 finalizeAST(ptr->expr);
587 break;
589 finalizeAST(ptr->typeId);
590 break;
592 finalizeAST(ptr->dynCast);
593 break;
595 finalizeAST(ptr->newExpr);
596 break;
598 finalizeAST(ptr->lambda);
599 break;
601 finalizeAST(ptr->func);
602 break;
605 break;
606 }
607 delete ptr;
608 }
609
611 finalizeAST(ptr->lhs);
612 delete ptr;
613 }
614
615 void finalizeAST(mulExpr *ptr) {
616 for (auto &i : ptr->getTerms())
617 finalizeAST(i);
618 delete ptr;
619 }
620
621 void finalizeAST(addExpr *ptr) {
622 for (auto &i : ptr->getTerms())
623 finalizeAST(i);
624 delete ptr;
625 }
626
628 for (auto &i : ptr->getTerms())
629 finalizeAST(i);
630 delete ptr;
631 }
632
634 for (auto &i : ptr->getTerms())
635 finalizeAST(i);
636 delete ptr;
637 }
638
640 for (auto &i : ptr->getTerms())
641 finalizeAST(i);
642 delete ptr;
643 }
644
645 void finalizeAST(andExpr *ptr) {
646 for (auto &i : ptr->getTerms())
647 finalizeAST(i);
648 delete ptr;
649 }
650
652 for (auto &i : ptr->getTerms())
653 finalizeAST(i);
654 delete ptr;
655 }
656
658 for (auto &i : ptr->getTerms())
659 finalizeAST(i);
660 delete ptr;
661 }
662
664 for (auto &i : ptr->getTerms())
665 finalizeAST(i);
666 delete ptr;
667 }
668
670 for (auto &i : ptr->getTerms())
671 finalizeAST(i);
672 delete ptr;
673 }
674
675 void finalizeAST(rExpr *ptr) {
676 finalizeAST(ptr->expr);
677 delete ptr;
678 }
679
681 for (auto &i : ptr->getStmts())
682 finalizeAST(i);
683 delete ptr;
684 }
685
686 void finalizeAST(useStmt *ptr) {
687 finalizeAST(ptr->name);
688 delete ptr;
689 }
690
692 finalizeAST(ptr->id);
694 finalizeAST(ptr->args);
695 finalizeAST(ptr->block);
696 delete ptr;
697 }
698
700 for (auto &i : ptr->getInner())
701 finalizeAST(i);
702
703 delete ptr;
704 }
705
707 if (ptr->isMethod()) {
708 finalizeAST(ptr->method);
709 } else {
710 finalizeAST(ptr->var);
711 }
712 delete ptr;
713 }
714
716 finalizeAST(ptr->id);
717 finalizeAST(ptr->inner);
718 delete ptr;
719 }
720
722 switch (ptr->kind) {
723 case 0:
724 finalizeAST(ptr->var);
725 break;
726 case 1:
727 finalizeAST(ptr->con);
728 break;
729 case 2:
730 finalizeAST(ptr->method);
731 break;
732 case 3:
734 break;
735 }
736 delete ptr;
737 }
738
740 for (auto &i : ptr->getInner())
741 finalizeAST(i);
742 delete ptr;
743 }
744
746 finalizeAST(ptr->id);
747 finalizeAST(ptr->inner);
748 delete ptr;
749 }
750
752 finalizeAST(ptr->id);
753 finalizeAST(ptr->inner);
754 delete ptr;
755 }
756
758 if (!ptr) return;
759 if (ptr->isConstructor()) {
760 finalizeAST(ptr->con);
761 } else if (ptr->isFinalizer()) {
763 } else if (ptr->met) {
764 finalizeAST(ptr->met);
765 }
766 delete ptr;
767 }
768
770 if (!ptr) return;
771 for (auto &i : ptr->getInner())
772 finalizeAST(i);
773 delete ptr;
774 }
775
777 if (!ptr) return;
778 if (ptr->isImplForStmt())
780 if (ptr->structName)
782 if (ptr->inner)
783 finalizeAST(ptr->inner);
784 delete ptr;
785 }
786
788 finalizeAST(ptr->lhs);
789 finalizeAST(ptr->rhs);
790 delete ptr;
791 }
792
793 void finalizeAST(letStmt *ptr) {
794 for (auto &i : ptr->getTerms())
795 finalizeAST(i);
796 delete ptr;
797 }
798
800 if (ptr->marco)
801 delete ptr->marco;
802 switch (ptr->kind) {
805 break;
808 break;
811 break;
814 break;
817 break;
820 break;
823 break;
826 break;
829 break;
832 break;
835 break;
838 break;
839 }
840 delete ptr;
841 }
842
843 void finalizeAST(ifStmt *ptr) {
844 finalizeAST(ptr->ifB.cond);
845 finalizeAST(ptr->ifB.block);
846 for (auto &i : ptr->elifB) {
847 finalizeAST(i.cond);
848 finalizeAST(i.block);
849 }
850 if (ptr->elseB)
851 finalizeAST(ptr->elseB);
852 delete ptr;
853 }
854
856 finalizeAST(ptr->cond);
857 finalizeAST(ptr->block);
858 delete ptr;
859 }
860
861 void finalizeAST(forStmt *ptr) {
862 finalizeAST(ptr->initStmt);
863 finalizeAST(ptr->cond);
865 finalizeAST(ptr->block);
866 delete ptr;
867 }
868
870 finalizeAST(ptr->var);
872 finalizeAST(ptr->block);
873 delete ptr;
874 }
875
877 if (ptr->hasValue())
878 finalizeAST(ptr->value);
879 delete ptr;
880 }
881
883 delete ptr;
884 }
885
887 delete ptr;
888 }
889
891 if (ptr->marco)
892 delete ptr->marco;
893 switch (ptr->kind) {
896 break;
899 break;
902 break;
905 break;
908 break;
911 break;
914 break;
917 break;
920 break;
923 break;
926 break;
929 break;
930 }
931 delete ptr;
932 }
933
936 finalizeAST(ptr->name);
937 finalizeAST(ptr->args);
938 delete ptr;
939 }
940
942 finalizeAST(ptr->args);
943 finalizeAST(ptr->name);
945 finalizeAST(ptr->block);
946 delete ptr;
947 }
948
950 finalizeAST(ptr->args);
951 delete ptr;
952 }
953
955 finalizeAST(ptr->args);
956 finalizeAST(ptr->block);
957 delete ptr;
958 }
959
963
965 return *args;
966 }
967
969 return *resultType;
970 }
971
975
977 return *args;
978 }
979
981 return *resultType;
982 }
983
985 return *block;
986 }
987
989 return *args;
990 }
991
993 return *args;
994 }
995
997 return *block;
998 }
999
1001 return stmts;
1002 }
1003
1007
1009 return terms.size() == 1;
1010 }
1011
1013 for (auto &term : ptr->getTerms()) {
1014 finalizeAST(term);
1015 }
1016 delete ptr;
1017 }
1018
1020 for (auto stmt : ptr->getStmts()) {
1021 finalizeAST(stmt);
1022 }
1023 delete ptr;
1024 }
1025
1027 if (ptr->hasRhs()) {
1028 finalizeAST(ptr->rhs);
1029 }
1030 finalizeAST(ptr->lhs);
1031 delete ptr;
1032 }
1033
1034 std::tuple<yoi::indexT, yoi::indexT> AST::getLocation() {
1035 return {token.line, token.col};
1036 }
1037
1039
1040 AST::AST(lexer::token token) : token(std::move(token)) {}
1041
1043 return token.col;
1044 }
1045
1047 return token.line;
1048 }
1049
1051 if (ptr->from) {
1052 finalizeAST(ptr->from);
1053 }
1054 if (ptr->as) {
1055 finalizeAST(ptr->as);
1056 }
1057 delete ptr;
1058 }
1059
1061 if (ptr->inner) {
1062 finalizeAST(ptr->inner);
1063 }
1064 delete ptr;
1065 }
1066
1068 if (ptr->isSubscript()) {
1069 finalizeAST(ptr->expr);
1070 } else if (ptr->isInvocation()) {
1071 finalizeAST(ptr->args);
1072 }
1073 delete ptr;
1074 }
1075
1077 return expr;
1078 }
1079
1081 return args;
1082 }
1083
1087
1089 return token;
1090 }
1091
1093 if (ptr->tryBlock) {
1094 finalizeAST(ptr->tryBlock);
1095 }
1096 for (auto catchParam : ptr->catchParams) {
1097 if (catchParam)
1099 }
1100 if (ptr->finallyBlock) {
1102 }
1103 delete ptr;
1104 }
1105
1107 if (ptr->type) {
1108 finalizeAST(ptr->type);
1109 }
1110 if (ptr->name) {
1111 finalizeAST(ptr->name);
1112 }
1113 if (ptr->block) {
1114 finalizeAST(ptr->block);
1115 }
1116 delete ptr;
1117 }
1118
1120 finalizeAST(ptr->expr);
1121 delete ptr;
1122 }
1123
1125 finalizeAST(ptr->expr);
1126 finalizeAST(ptr->type);
1127 delete ptr;
1128 }
1129
1131 if (ptr->expr)
1132 finalizeAST(ptr->expr);
1133 if (ptr->type)
1134 finalizeAST(ptr->type);
1135 delete ptr;
1136 }
1137
1139 finalizeAST(ptr->type);
1140 finalizeAST(ptr->args);
1141 delete ptr;
1142 }
1143
1145 return *lhs;
1146 }
1148 return op;
1149 }
1154 finalizeAST(ptr->lhs);
1155 if (ptr->rhs)
1156 finalizeAST(ptr->rhs);
1157 delete ptr;
1158 }
1159
1161 for (auto &i : ptr->captures) {
1162 finalizeAST(i);
1163 }
1164 finalizeAST(ptr->args);
1165 finalizeAST(ptr->block);
1166 finalizeAST(ptr->resultType);
1167 ptr->captures.clear();
1168 delete ptr;
1169 }
1170
1172 for (auto &arg : ptr->types) {
1173 finalizeAST(arg);
1174 }
1175 delete ptr;
1176 }
1177
1179 for (auto &i : ptr->pairs) {
1180 delete i;
1181 }
1182 delete ptr;
1183 }
1184
1186 delete ptr;
1187 }
1188
1190 delete ptr->lhs;
1191 delete ptr->rhs;
1192 }
1193
1195 return *block;
1196 }
1197
1201
1203 return !isConstructor() && !isFinalizer();
1204 }
1205
1207 return finalizer;
1208 }
1209
1213
1215 delete ptr;
1216 }
1217
1219 finalizeAST(ptr->block);
1220 delete ptr;
1221 }
1222
1224 if (ptr->args)
1225 finalizeAST(ptr->args);
1226
1227 finalizeAST(ptr->name);
1228 delete ptr;
1229 }
1230
1232 switch (ptr->kind) {
1234 finalizeAST(ptr->id);
1235 break;
1237 break;
1238 }
1239 delete ptr;
1240 }
1242 finalizeAST(ptr->name);
1243 for (auto &i : ptr->values)
1244 finalizeAST(i);
1245 delete ptr;
1246 }
1247
1249 finalizeAST(ptr->name);
1250 delete ptr;
1251 }
1252
1254 for (auto &expr : ptr->exprs)
1255 finalizeAST(expr);
1256 delete ptr;
1257 }
1258
1260 if (ptr->expr) {
1261 finalizeAST(ptr->expr);
1262 }
1263 delete ptr;
1264 }
1265
1267 finalizeAST(ptr->expr);
1268 delete ptr;
1269 }
1270
1272 switch (ptr->kind) {
1275 break;
1276 }
1279 break;
1280 }
1281 }
1282 delete ptr;
1283 }
1284
1286 finalizeAST(ptr->emae);
1287 delete ptr;
1288 }
1289
1291 for (auto &i : ptr->emaes)
1292 finalizeAST(i);
1293 delete ptr;
1294 }
1295
1297 for (auto &i : ptr->conceptBlock)
1298 finalizeAST(i);
1299
1300 for (auto &i : ptr->algebraParams)
1301 finalizeAST(i);
1302 delete ptr;
1303 }
1304
1306 delete ptr;
1307 }
1308} // namespace yoi
yoi::indexT getColumn()
Definition ast.cpp:1042
lexer::token token
Definition ast.hpp:16
yoi::lexer::token & getToken()
Definition ast.cpp:1088
yoi::indexT getLine()
Definition ast.cpp:1046
std::tuple< yoi::indexT, yoi::indexT > getLocation()
Definition ast.cpp:1034
externModuleAccessExpression * rhs
Definition ast.hpp:440
externModuleAccessExpression & getRhs() const
Definition ast.cpp:1150
primary & getLhs() const
Definition ast.cpp:1144
primary * lhs
Definition ast.hpp:438
lexer::token op
Definition ast.hpp:439
lexer::token & getOp()
Definition ast.cpp:1147
vec< mulExpr * > terms
Definition ast.hpp:490
vec< lexer::token > ops
Definition ast.hpp:491
vec< mulExpr * > & getTerms()
Definition ast.cpp:151
vec< lexer::token > & getOp()
Definition ast.cpp:155
vec< equalityExpr * > & getTerms()
Definition ast.cpp:199
vec< lexer::token > ops
Definition ast.hpp:539
vec< lexer::token > & getOp()
Definition ast.cpp:203
vec< equalityExpr * > terms
Definition ast.hpp:538
lexer::token node
Definition ast.hpp:247
lexer::token & get()
Definition ast.cpp:8
yoi::vec< yoi::rExpr * > exprs
Definition ast.hpp:218
codeBlock * block
Definition ast.hpp:1069
identifier * name
Definition ast.hpp:1068
typeSpec * type
Definition ast.hpp:1067
vec< inCodeBlockStmt * > & getStmts()
Definition ast.cpp:471
yoi::vec< identifierWithTypeSpec * > algebraParams
Definition ast.hpp:1117
yoi::vec< conceptStmt * > conceptBlock
Definition ast.hpp:1119
union yoi::conceptStmt::ConceptStmtValue value
enum yoi::conceptStmt::Kind kind
definitionArguments & getArgs()
Definition ast.cpp:988
definitionArguments * args
Definition ast.hpp:994
codeBlock * block
Definition ast.hpp:1007
codeBlock & getBlock()
Definition ast.cpp:996
definitionArguments & getArgs()
Definition ast.cpp:992
definitionArguments * args
Definition ast.hpp:1006
structDefInner * inner
Definition ast.hpp:724
identifier & getId()
Definition ast.cpp:335
structDefInner & getInner()
Definition ast.cpp:339
identifier * id
Definition ast.hpp:723
rExpr * expr
Definition ast.hpp:615
satisfyClause * satisfyCondition
Definition ast.hpp:272
identifier & getId() const
Definition ast.cpp:24
identifier * id
Definition ast.hpp:271
vec< defTemplateArgSpec * > & get()
Definition ast.cpp:27
vec< defTemplateArgSpec * > spec
Definition ast.hpp:279
vec< identifierWithTypeSpec * > spec
Definition ast.hpp:307
vec< identifierWithTypeSpec * > & get()
Definition ast.cpp:43
vec< enumerationPair * > values
Definition ast.hpp:1099
identifier * name
Definition ast.hpp:1104
vec< relationalExpr * > & getTerms()
Definition ast.cpp:187
vec< relationalExpr * > terms
Definition ast.hpp:526
vec< lexer::token > ops
Definition ast.hpp:527
vec< lexer::token > & getOp()
Definition ast.cpp:191
vec< andExpr * > & getTerms()
Definition ast.cpp:211
vec< lexer::token > ops
Definition ast.hpp:551
vec< lexer::token > & getOp()
Definition ast.cpp:215
vec< andExpr * > terms
Definition ast.hpp:550
typeSpec * from
Definition ast.hpp:1050
identifier * as
Definition ast.hpp:1051
vec< identifierWithTemplateArg * > & getTerms()
Definition ast.cpp:1004
codeBlock * block
Definition ast.hpp:1016
codeBlock & getBlock()
Definition ast.cpp:1194
codeBlock * block
Definition ast.hpp:896
rExpr * container
Definition ast.hpp:895
codeBlock & getBlock()
Definition ast.cpp:451
identifier * var
Definition ast.hpp:894
rExpr & getContainer()
Definition ast.cpp:447
identifier & getVar()
Definition ast.cpp:443
codeBlock * block
Definition ast.hpp:881
inCodeBlockStmt * afterStmt
Definition ast.hpp:880
codeBlock & getBlock()
Definition ast.cpp:439
inCodeBlockStmt * initStmt
Definition ast.hpp:878
rExpr & getCond()
Definition ast.cpp:431
rExpr * cond
Definition ast.hpp:879
inCodeBlockStmt & getAfterStmt()
Definition ast.cpp:435
inCodeBlockStmt & getInitStmt()
Definition ast.cpp:427
codeBlock * block
Definition ast.hpp:624
typeSpec & getResultType()
Definition ast.cpp:279
codeBlock & getBlock()
Definition ast.cpp:283
identifierWithDefTemplateArg * id
Definition ast.hpp:621
definitionArguments & getArgs()
Definition ast.cpp:275
typeSpec * resultType
Definition ast.hpp:623
identifierWithDefTemplateArg & getId()
Definition ast.cpp:271
definitionArguments * args
Definition ast.hpp:622
externModuleAccessExpression * name
Definition ast.hpp:241
unnamedDefinitionArguments * args
Definition ast.hpp:242
typeSpec * resultType
Definition ast.hpp:315
unnamedDefinitionArguments & getArgs() const
Definition ast.cpp:47
typeSpec & getResultType() const
Definition ast.cpp:51
unnamedDefinitionArguments * args
Definition ast.hpp:314
vValue & getValue()
Definition ast.cpp:391
vKind & getKind()
Definition ast.cpp:387
union yoi::globalStmt::vValue value
enum yoi::globalStmt::vKind kind
marcoDescriptor * marco
Definition ast.hpp:817
vec< globalStmt * > & getStmts()
Definition ast.cpp:1000
defTemplateArg & getArg() const
Definition ast.cpp:83
identifier & getId() const
Definition ast.cpp:79
identifier & getId() const
Definition ast.cpp:67
bool hasTemplateArg() const
Definition ast.cpp:75
templateArg & getArg() const
Definition ast.cpp:71
identifier & getId() const
Definition ast.cpp:16
typeSpec & getSpec() const
Definition ast.cpp:20
lexer::token node
Definition ast.hpp:254
lexer::token & get()
Definition ast.cpp:12
vec< ifBlock > elifB
Definition ast.hpp:854
vec< ifBlock > & getElifBlock()
Definition ast.cpp:407
codeBlock & getElseBlock()
Definition ast.cpp:411
codeBlock * elseB
Definition ast.hpp:855
ifBlock & getIfBlock()
Definition ast.cpp:403
ifBlock ifB
Definition ast.hpp:853
bool hasElseBlock() const
Definition ast.cpp:415
bool isFinalizer() const
Definition ast.cpp:1206
bool isMethod() const
Definition ast.cpp:1202
innerMethodDef * met
Definition ast.hpp:736
innerMethodDef & getMethod()
Definition ast.cpp:347
finalizerDef * finalizer
Definition ast.hpp:738
finalizerDef & getFinalizer()
Definition ast.cpp:1210
constructorDef * con
Definition ast.hpp:734
constructorDef & getConstructor()
Definition ast.cpp:343
bool isConstructor() const
Definition ast.cpp:351
vec< implInnerPair * > & getInner()
Definition ast.cpp:355
vec< implInnerPair * > inner
Definition ast.hpp:755
bool isImplForStmt()
Definition ast.cpp:367
implInner * inner
Definition ast.hpp:764
implInner & getInner()
Definition ast.cpp:371
externModuleAccessExpression & getInterfaceId()
Definition ast.cpp:359
externModuleAccessExpression & getStructId()
Definition ast.cpp:363
externModuleAccessExpression * structName
Definition ast.hpp:763
externModuleAccessExpression * interfaceName
Definition ast.hpp:762
innerMethodDecl * inner
Definition ast.hpp:1056
union yoi::inCodeBlockStmt::vValue value
vKind & getKind()
Definition ast.cpp:463
enum yoi::inCodeBlockStmt::vKind kind
marcoDescriptor * marco
Definition ast.hpp:936
vValue & getValue()
Definition ast.cpp:467
vec< lexer::token > ops
Definition ast.hpp:563
vec< exclusiveExpr * > terms
Definition ast.hpp:562
vec< lexer::token > & getOp()
Definition ast.cpp:227
vec< exclusiveExpr * > & getTerms()
Definition ast.cpp:223
typeSpec & getResultType()
Definition ast.cpp:968
definitionArguments & getArgs()
Definition ast.cpp:964
typeSpec * resultType
Definition ast.hpp:965
identifierWithDefTemplateArg * name
Definition ast.hpp:963
definitionArguments * args
Definition ast.hpp:964
identifierWithDefTemplateArg & getName()
Definition ast.cpp:960
codeBlock * block
Definition ast.hpp:980
typeSpec & getResultType()
Definition ast.cpp:980
identifierWithTemplateArg & getName()
Definition ast.cpp:972
codeBlock & getBlock()
Definition ast.cpp:984
definitionArguments & getArgs()
Definition ast.cpp:976
typeSpec * resultType
Definition ast.hpp:979
definitionArguments * args
Definition ast.hpp:978
identifierWithTemplateArg * name
Definition ast.hpp:977
innerMethodDecl * method
Definition ast.hpp:643
innerMethodDecl & getMethod()
Definition ast.cpp:295
identifierWithTypeSpec & getVar()
Definition ast.cpp:287
identifierWithTypeSpec * var
Definition ast.hpp:638
vec< interfaceDefInnerPair * > & getInner()
Definition ast.cpp:299
vec< interfaceDefInnerPair * > inner
Definition ast.hpp:652
identifierWithDefTemplateArg * id
Definition ast.hpp:659
identifierWithDefTemplateArg & getId()
Definition ast.cpp:303
interfaceDefInner & getInner()
Definition ast.cpp:307
interfaceDefInner * inner
Definition ast.hpp:660
vec< rExpr * > & get()
Definition ast.cpp:39
vec< rExpr * > arg
Definition ast.hpp:300
codeBlock * block
Definition ast.hpp:701
vec< yoi::lambdaCapture * > captures
Definition ast.hpp:698
typeSpec * resultType
Definition ast.hpp:700
definitionArguments * args
Definition ast.hpp:699
rExpr * rhs
Definition ast.hpp:465
uniqueExpr & getLhs() const
Definition ast.cpp:127
lexer::token op
Definition ast.hpp:463
uniqueExpr * lhs
Definition ast.hpp:464
lexer::token & getOp()
Definition ast.cpp:123
rExpr & getRhs() const
Definition ast.cpp:131
bool hasRhs() const
Definition ast.cpp:135
enum yoi::letAssignmentPairLHS::vKind kind
letAssignmentPairLHS * lhs
Definition ast.hpp:784
letAssignmentPairLHS & getLhs()
Definition ast.cpp:375
vec< letAssignmentPair * > & getTerms()
Definition ast.cpp:383
vec< letAssignmentPair * > terms
Definition ast.hpp:795
vec< lexer::token > ops
Definition ast.hpp:575
vec< lexer::token > & getOp()
Definition ast.cpp:239
vec< inclusiveExpr * > terms
Definition ast.hpp:574
vec< inclusiveExpr * > & getTerms()
Definition ast.cpp:235
vec< lexer::token > ops
Definition ast.hpp:587
vec< logicalAndExpr * > & getTerms()
Definition ast.cpp:247
vec< lexer::token > & getOp()
Definition ast.cpp:251
vec< logicalAndExpr * > terms
Definition ast.hpp:586
yoi::vec< marcoPair * > pairs
Definition ast.hpp:236
vec< subscriptExpr * > & getTerms()
Definition ast.cpp:95
vec< subscriptExpr * > terms
Definition ast.hpp:391
vec< leftExpr * > terms
Definition ast.hpp:478
vec< lexer::token > ops
Definition ast.hpp:479
vec< lexer::token > & getOp()
Definition ast.cpp:143
vec< leftExpr * > & getTerms()
Definition ast.cpp:139
invocationArguments * args
Definition ast.hpp:400
externModuleAccessExpression * type
Definition ast.hpp:398
lambdaExpr * lambda
Definition ast.hpp:424
enum yoi::primary::primaryKind kind
funcExpr * func
Definition ast.hpp:425
memberExpr * member
Definition ast.hpp:418
rExpr & getExpr() const
Definition ast.cpp:107
rExpr * expr
Definition ast.hpp:420
memberExpr & getMemberExpr() const
Definition ast.cpp:99
basicLiterals * literals
Definition ast.hpp:419
newExpression * newExpr
Definition ast.hpp:423
bracedInitalizerList * bracedInitalizer
Definition ast.hpp:426
basicLiterals & getLiterals() const
Definition ast.cpp:103
typeIdExpression * typeId
Definition ast.hpp:421
dynCastExpression * dynCast
Definition ast.hpp:422
logicalOrExpr * expr
Definition ast.hpp:598
logicalOrExpr & getExpr() const
Definition ast.cpp:259
vec< lexer::token > ops
Definition ast.hpp:515
vec< shiftExpr * > & getTerms()
Definition ast.cpp:175
vec< shiftExpr * > terms
Definition ast.hpp:514
vec< lexer::token > & getOp()
Definition ast.cpp:179
rExpr * value
Definition ast.hpp:907
rExpr & getValue()
Definition ast.cpp:455
bool hasValue() const
Definition ast.cpp:459
yoi::vec< externModuleAccessExpression * > emaes
Definition ast.hpp:1145
externModuleAccessExpression * emae
Definition ast.hpp:1140
vec< lexer::token > ops
Definition ast.hpp:503
vec< lexer::token > & getOp()
Definition ast.cpp:167
vec< addExpr * > terms
Definition ast.hpp:502
vec< addExpr * > & getTerms()
Definition ast.cpp:163
innerMethodDecl * method
Definition ast.hpp:677
innerMethodDecl & getMethod()
Definition ast.cpp:319
constructorDecl & getConstructor()
Definition ast.cpp:315
constructorDecl * con
Definition ast.hpp:675
identifierWithTypeSpec & getVar()
Definition ast.cpp:311
finalizerDecl * finalizer
Definition ast.hpp:679
finalizerDecl & getFinalizer()
Definition ast.cpp:1198
identifierWithTypeSpec * var
Definition ast.hpp:673
vec< structDefInnerPair * > & getInner()
Definition ast.cpp:323
vec< structDefInnerPair * > inner
Definition ast.hpp:706
structDefInner * inner
Definition ast.hpp:714
identifierWithDefTemplateArg * id
Definition ast.hpp:713
identifierWithDefTemplateArg & getId()
Definition ast.cpp:327
structDefInner & getInner()
Definition ast.cpp:331
vec< subscript * > & getSubscript()
Definition ast.cpp:1084
vec< subscript * > subscriptVal
Definition ast.hpp:382
bool isIdentifier() const
Definition ast.cpp:91
identifierWithTemplateArg * id
Definition ast.hpp:381
bool isInvocation() const
Definition ast.cpp:1080
rExpr & getExpr() const
Definition ast.cpp:63
rExpr * expr
Definition ast.hpp:345
bool isSubscript() const
Definition ast.cpp:1076
invocationArguments * args
Definition ast.hpp:346
typeSpec * spec
Definition ast.hpp:286
typeSpec & get() const
Definition ast.cpp:31
vec< templateArgSpec * > spec
Definition ast.hpp:293
vec< templateArgSpec * > & get()
Definition ast.cpp:35
rExpr * expr
Definition ast.hpp:1062
vec< catchParam * > catchParams
Definition ast.hpp:1075
codeBlock * tryBlock
Definition ast.hpp:1074
codeBlock * finallyBlock
Definition ast.hpp:1076
yoi::identifierWithDefTemplateArg * lhs
Definition ast.hpp:223
yoi::typeSpec * rhs
Definition ast.hpp:224
typeSpec * type
Definition ast.hpp:1081
decltypeExpr * decltypeExpression
Definition ast.hpp:334
yoi::vec< uint64_t > * arraySubscript
Definition ast.hpp:336
funcTypeSpec & getTypeSpec() const
Definition ast.cpp:59
externModuleAccessExpression * member
Definition ast.hpp:331
funcTypeSpec * func
Definition ast.hpp:332
enum yoi::typeSpec::typeSpecKind kind
externModuleAccessExpression & getMemberExpr() const
Definition ast.cpp:55
abstractExpr & getLhs() const
Definition ast.cpp:115
lexer::token op
Definition ast.hpp:451
lexer::token & getOp()
Definition ast.cpp:111
abstractExpr * lhs
Definition ast.hpp:452
vec< typeSpec * > types
Definition ast.hpp:1093
identifier * name
Definition ast.hpp:605
identifier & getName()
Definition ast.cpp:263
lexer::token path
Definition ast.hpp:606
lexer::token & getPath()
Definition ast.cpp:267
codeBlock * block
Definition ast.hpp:869
codeBlock & getBlock()
Definition ast.cpp:423
rExpr & getCond()
Definition ast.cpp:419
rExpr * cond
Definition ast.hpp:868
rExpr * expr
Definition ast.hpp:1110
Definition json.hpp:5639
std::vector< t > vec
Definition def.hpp:56
void finalizeAST(funcTypeSpec *ptr)
Definition ast.cpp:475
uint64_t indexT
Definition def.hpp:54
codeBlock * block
Definition ast.hpp:846
codeBlock & getBlock()
Definition ast.cpp:399
rExpr & getCond()
Definition ast.cpp:395
uint64_t col
Definition lexer.hpp:26
uint64_t line
Definition lexer.hpp:26
dataStructDefStmt * dataStructDefStmtVal
Definition ast.hpp:823
enumerationDefinition * enumerationDefVal
Definition ast.hpp:830
useStmt * useStmtVal
Definition ast.hpp:820
implStmt * implStmtVal
Definition ast.hpp:824
interfaceDefStmt * interfaceDefStmtVal
Definition ast.hpp:821
letStmt * letStmtVal
Definition ast.hpp:825
conceptDefinition * conceptDefVal
Definition ast.hpp:831
funcDefStmt * funcDefStmtVal
Definition ast.hpp:826
typeAliasStmt * typeAliasStmtVal
Definition ast.hpp:829
exportDecl * exportDeclVal
Definition ast.hpp:828
structDefStmt * structDefStmtVal
Definition ast.hpp:822
importDecl * importDeclVal
Definition ast.hpp:827
returnStmt * returnStmtVal
Definition ast.hpp:942
continueStmt * continueStmtVal
Definition ast.hpp:943