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->isConstructor()) {
759 finalizeAST(ptr->con);
760 } else if (ptr->isFinalizer()) {
762 } else {
763 finalizeAST(ptr->met);
764 }
765 delete ptr;
766 }
767
769 for (auto &i : ptr->getInner())
770 finalizeAST(i);
771 delete ptr;
772 }
773
775 if (ptr->isImplForStmt())
778 finalizeAST(ptr->inner);
779 delete ptr;
780 }
781
783 finalizeAST(ptr->lhs);
784 finalizeAST(ptr->rhs);
785 delete ptr;
786 }
787
788 void finalizeAST(letStmt *ptr) {
789 for (auto &i : ptr->getTerms())
790 finalizeAST(i);
791 delete ptr;
792 }
793
795 if (ptr->marco)
796 delete ptr->marco;
797 switch (ptr->kind) {
800 break;
803 break;
806 break;
809 break;
812 break;
815 break;
818 break;
821 break;
824 break;
827 break;
830 break;
833 break;
834 }
835 delete ptr;
836 }
837
838 void finalizeAST(ifStmt *ptr) {
839 finalizeAST(ptr->ifB.cond);
840 finalizeAST(ptr->ifB.block);
841 for (auto &i : ptr->elifB) {
842 finalizeAST(i.cond);
843 finalizeAST(i.block);
844 }
845 if (ptr->elseB)
846 finalizeAST(ptr->elseB);
847 delete ptr;
848 }
849
851 finalizeAST(ptr->cond);
852 finalizeAST(ptr->block);
853 delete ptr;
854 }
855
856 void finalizeAST(forStmt *ptr) {
857 finalizeAST(ptr->initStmt);
858 finalizeAST(ptr->cond);
860 finalizeAST(ptr->block);
861 delete ptr;
862 }
863
865 finalizeAST(ptr->var);
867 finalizeAST(ptr->block);
868 delete ptr;
869 }
870
872 if (ptr->hasValue())
873 finalizeAST(ptr->value);
874 delete ptr;
875 }
876
878 delete ptr;
879 }
880
882 delete ptr;
883 }
884
886 if (ptr->marco)
887 delete ptr->marco;
888 switch (ptr->kind) {
891 break;
894 break;
897 break;
900 break;
903 break;
906 break;
909 break;
912 break;
915 break;
918 break;
921 break;
924 break;
925 }
926 delete ptr;
927 }
928
931 finalizeAST(ptr->name);
932 finalizeAST(ptr->args);
933 delete ptr;
934 }
935
937 finalizeAST(ptr->args);
938 finalizeAST(ptr->name);
940 finalizeAST(ptr->block);
941 delete ptr;
942 }
943
945 finalizeAST(ptr->args);
946 delete ptr;
947 }
948
950 finalizeAST(ptr->args);
951 finalizeAST(ptr->block);
952 delete ptr;
953 }
954
958
960 return *args;
961 }
962
964 return *resultType;
965 }
966
970
972 return *args;
973 }
974
976 return *resultType;
977 }
978
980 return *block;
981 }
982
984 return *args;
985 }
986
988 return *args;
989 }
990
992 return *block;
993 }
994
996 return stmts;
997 }
998
1002
1004 return terms.size() == 1;
1005 }
1006
1008 for (auto &term : ptr->getTerms()) {
1009 finalizeAST(term);
1010 }
1011 delete ptr;
1012 }
1013
1015 for (auto stmt : ptr->getStmts()) {
1016 finalizeAST(stmt);
1017 }
1018 delete ptr;
1019 }
1020
1022 if (ptr->hasRhs()) {
1023 finalizeAST(ptr->rhs);
1024 }
1025 finalizeAST(ptr->lhs);
1026 delete ptr;
1027 }
1028
1029 std::tuple<yoi::indexT, yoi::indexT> AST::getLocation() {
1030 return {token.line, token.col};
1031 }
1032
1034
1035 AST::AST(lexer::token token) : token(std::move(token)) {}
1036
1038 return token.col;
1039 }
1040
1042 return token.line;
1043 }
1044
1046 if (ptr->from) {
1047 finalizeAST(ptr->from);
1048 }
1049 if (ptr->as) {
1050 finalizeAST(ptr->as);
1051 }
1052 delete ptr;
1053 }
1054
1056 if (ptr->inner) {
1057 finalizeAST(ptr->inner);
1058 }
1059 delete ptr;
1060 }
1061
1063 if (ptr->isSubscript()) {
1064 finalizeAST(ptr->expr);
1065 } else if (ptr->isInvocation()) {
1066 finalizeAST(ptr->args);
1067 }
1068 delete ptr;
1069 }
1070
1072 return expr;
1073 }
1074
1076 return args;
1077 }
1078
1082
1084 return token;
1085 }
1086
1088 if (ptr->tryBlock) {
1089 finalizeAST(ptr->tryBlock);
1090 }
1091 for (auto catchParam : ptr->catchParams) {
1092 if (catchParam)
1094 }
1095 if (ptr->finallyBlock) {
1097 }
1098 delete ptr;
1099 }
1100
1102 if (ptr->type) {
1103 finalizeAST(ptr->type);
1104 }
1105 if (ptr->name) {
1106 finalizeAST(ptr->name);
1107 }
1108 if (ptr->block) {
1109 finalizeAST(ptr->block);
1110 }
1111 delete ptr;
1112 }
1113
1115 finalizeAST(ptr->expr);
1116 delete ptr;
1117 }
1118
1120 finalizeAST(ptr->expr);
1121 finalizeAST(ptr->type);
1122 delete ptr;
1123 }
1124
1126 if (ptr->expr)
1127 finalizeAST(ptr->expr);
1128 if (ptr->type)
1129 finalizeAST(ptr->type);
1130 delete ptr;
1131 }
1132
1134 finalizeAST(ptr->type);
1135 finalizeAST(ptr->args);
1136 delete ptr;
1137 }
1138
1140 return *lhs;
1141 }
1143 return op;
1144 }
1149 finalizeAST(ptr->lhs);
1150 if (ptr->rhs)
1151 finalizeAST(ptr->rhs);
1152 delete ptr;
1153 }
1154
1156 for (auto &i : ptr->captures) {
1157 finalizeAST(i);
1158 }
1159 finalizeAST(ptr->args);
1160 finalizeAST(ptr->block);
1161 finalizeAST(ptr->resultType);
1162 ptr->captures.clear();
1163 delete ptr;
1164 }
1165
1167 for (auto &arg : ptr->types) {
1168 finalizeAST(arg);
1169 }
1170 delete ptr;
1171 }
1172
1174 for (auto &i : ptr->pairs) {
1175 delete i;
1176 }
1177 delete ptr;
1178 }
1179
1181 delete ptr;
1182 }
1183
1185 delete ptr->lhs;
1186 delete ptr->rhs;
1187 }
1188
1190 return *block;
1191 }
1192
1196
1198 return !isConstructor() && !isFinalizer();
1199 }
1200
1202 return finalizer;
1203 }
1204
1208
1210 delete ptr;
1211 }
1212
1214 finalizeAST(ptr->block);
1215 delete ptr;
1216 }
1217
1219 finalizeAST(ptr->args);
1220 finalizeAST(ptr->name);
1221 delete ptr;
1222 }
1223
1225 switch (ptr->kind) {
1227 finalizeAST(ptr->id);
1228 break;
1230 break;
1231 }
1232 delete ptr;
1233 }
1235 finalizeAST(ptr->name);
1236 for (auto &i : ptr->values)
1237 finalizeAST(i);
1238 delete ptr;
1239 }
1240
1242 finalizeAST(ptr->name);
1243 delete ptr;
1244 }
1245
1247 for (auto &expr : ptr->exprs)
1248 finalizeAST(expr);
1249 delete ptr;
1250 }
1251
1253 if (ptr->expr) {
1254 finalizeAST(ptr->expr);
1255 }
1256 delete ptr;
1257 }
1258
1260 finalizeAST(ptr->expr);
1261 delete ptr;
1262 }
1263
1265 switch (ptr->kind) {
1268 break;
1269 }
1272 break;
1273 }
1274 }
1275 delete ptr;
1276 }
1277
1279 finalizeAST(ptr->emae);
1280 delete ptr;
1281 }
1282
1284 for (auto &i : ptr->emaes)
1285 finalizeAST(i);
1286 delete ptr;
1287 }
1288
1290 for (auto &i : ptr->conceptBlock)
1291 finalizeAST(i);
1292
1293 for (auto &i : ptr->algebraParams)
1294 finalizeAST(i);
1295 delete ptr;
1296 }
1297} // namespace yoi
yoi::indexT getColumn()
Definition ast.cpp:1037
lexer::token token
Definition ast.hpp:16
yoi::lexer::token & getToken()
Definition ast.cpp:1083
yoi::indexT getLine()
Definition ast.cpp:1041
std::tuple< yoi::indexT, yoi::indexT > getLocation()
Definition ast.cpp:1029
externModuleAccessExpression * rhs
Definition ast.hpp:446
externModuleAccessExpression & getRhs() const
Definition ast.cpp:1145
primary & getLhs() const
Definition ast.cpp:1139
primary * lhs
Definition ast.hpp:444
lexer::token op
Definition ast.hpp:445
lexer::token & getOp()
Definition ast.cpp:1142
vec< mulExpr * > terms
Definition ast.hpp:496
vec< lexer::token > ops
Definition ast.hpp:497
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:545
vec< lexer::token > & getOp()
Definition ast.cpp:203
vec< equalityExpr * > terms
Definition ast.hpp:544
lexer::token node
Definition ast.hpp:253
lexer::token & get()
Definition ast.cpp:8
yoi::vec< yoi::rExpr * > exprs
Definition ast.hpp:216
codeBlock * block
Definition ast.hpp:1058
identifier * name
Definition ast.hpp:1057
typeSpec * type
Definition ast.hpp:1056
vec< inCodeBlockStmt * > & getStmts()
Definition ast.cpp:471
yoi::vec< identifierWithTypeSpec * > algebraParams
Definition ast.hpp:1106
yoi::vec< conceptStmt * > conceptBlock
Definition ast.hpp:1108
union yoi::conceptStmt::ConceptStmtValue value
enum yoi::conceptStmt::Kind kind
definitionArguments & getArgs()
Definition ast.cpp:983
definitionArguments * args
Definition ast.hpp:986
codeBlock * block
Definition ast.hpp:999
codeBlock & getBlock()
Definition ast.cpp:991
definitionArguments & getArgs()
Definition ast.cpp:987
definitionArguments * args
Definition ast.hpp:998
structDefInner * inner
Definition ast.hpp:716
identifier & getId()
Definition ast.cpp:335
structDefInner & getInner()
Definition ast.cpp:339
identifier * id
Definition ast.hpp:715
rExpr * expr
Definition ast.hpp:621
satisfyClause * satisfyCondition
Definition ast.hpp:278
identifier & getId() const
Definition ast.cpp:24
identifier * id
Definition ast.hpp:277
vec< defTemplateArgSpec * > & get()
Definition ast.cpp:27
vec< defTemplateArgSpec * > spec
Definition ast.hpp:285
vec< identifierWithTypeSpec * > spec
Definition ast.hpp:313
vec< identifierWithTypeSpec * > & get()
Definition ast.cpp:43
vec< enumerationPair * > values
Definition ast.hpp:1088
identifier * name
Definition ast.hpp:1093
vec< relationalExpr * > & getTerms()
Definition ast.cpp:187
vec< relationalExpr * > terms
Definition ast.hpp:532
vec< lexer::token > ops
Definition ast.hpp:533
vec< lexer::token > & getOp()
Definition ast.cpp:191
vec< andExpr * > & getTerms()
Definition ast.cpp:211
vec< lexer::token > ops
Definition ast.hpp:557
vec< lexer::token > & getOp()
Definition ast.cpp:215
vec< andExpr * > terms
Definition ast.hpp:556
typeSpec * from
Definition ast.hpp:1039
identifier * as
Definition ast.hpp:1040
vec< identifierWithTemplateArg * > & getTerms()
Definition ast.cpp:999
codeBlock * block
Definition ast.hpp:1008
codeBlock & getBlock()
Definition ast.cpp:1189
codeBlock * block
Definition ast.hpp:888
rExpr * container
Definition ast.hpp:887
codeBlock & getBlock()
Definition ast.cpp:451
identifier * var
Definition ast.hpp:886
rExpr & getContainer()
Definition ast.cpp:447
identifier & getVar()
Definition ast.cpp:443
codeBlock * block
Definition ast.hpp:873
inCodeBlockStmt * afterStmt
Definition ast.hpp:872
codeBlock & getBlock()
Definition ast.cpp:439
inCodeBlockStmt * initStmt
Definition ast.hpp:870
rExpr & getCond()
Definition ast.cpp:431
rExpr * cond
Definition ast.hpp:871
inCodeBlockStmt & getAfterStmt()
Definition ast.cpp:435
inCodeBlockStmt & getInitStmt()
Definition ast.cpp:427
codeBlock * block
Definition ast.hpp:630
typeSpec & getResultType()
Definition ast.cpp:279
codeBlock & getBlock()
Definition ast.cpp:283
identifierWithDefTemplateArg * id
Definition ast.hpp:627
definitionArguments & getArgs()
Definition ast.cpp:275
typeSpec * resultType
Definition ast.hpp:629
identifierWithDefTemplateArg & getId()
Definition ast.cpp:271
definitionArguments * args
Definition ast.hpp:628
externModuleAccessExpression * name
Definition ast.hpp:247
unnamedDefinitionArguments * args
Definition ast.hpp:248
typeSpec * resultType
Definition ast.hpp:321
unnamedDefinitionArguments & getArgs() const
Definition ast.cpp:47
typeSpec & getResultType() const
Definition ast.cpp:51
unnamedDefinitionArguments * args
Definition ast.hpp:320
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:809
vec< globalStmt * > & getStmts()
Definition ast.cpp:995
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:260
lexer::token & get()
Definition ast.cpp:12
vec< ifBlock > elifB
Definition ast.hpp:846
vec< ifBlock > & getElifBlock()
Definition ast.cpp:407
codeBlock & getElseBlock()
Definition ast.cpp:411
codeBlock * elseB
Definition ast.hpp:847
ifBlock & getIfBlock()
Definition ast.cpp:403
ifBlock ifB
Definition ast.hpp:845
bool hasElseBlock() const
Definition ast.cpp:415
bool isFinalizer() const
Definition ast.cpp:1201
bool isMethod() const
Definition ast.cpp:1197
innerMethodDef * met
Definition ast.hpp:728
innerMethodDef & getMethod()
Definition ast.cpp:347
finalizerDef * finalizer
Definition ast.hpp:730
finalizerDef & getFinalizer()
Definition ast.cpp:1205
constructorDef * con
Definition ast.hpp:726
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:747
bool isImplForStmt()
Definition ast.cpp:367
implInner * inner
Definition ast.hpp:756
implInner & getInner()
Definition ast.cpp:371
externModuleAccessExpression & getInterfaceId()
Definition ast.cpp:359
externModuleAccessExpression & getStructId()
Definition ast.cpp:363
externModuleAccessExpression * structName
Definition ast.hpp:755
externModuleAccessExpression * interfaceName
Definition ast.hpp:754
innerMethodDecl * inner
Definition ast.hpp:1045
union yoi::inCodeBlockStmt::vValue value
vKind & getKind()
Definition ast.cpp:463
enum yoi::inCodeBlockStmt::vKind kind
marcoDescriptor * marco
Definition ast.hpp:928
vValue & getValue()
Definition ast.cpp:467
vec< lexer::token > ops
Definition ast.hpp:569
vec< exclusiveExpr * > terms
Definition ast.hpp:568
vec< lexer::token > & getOp()
Definition ast.cpp:227
vec< exclusiveExpr * > & getTerms()
Definition ast.cpp:223
typeSpec & getResultType()
Definition ast.cpp:963
definitionArguments & getArgs()
Definition ast.cpp:959
typeSpec * resultType
Definition ast.hpp:957
identifierWithDefTemplateArg * name
Definition ast.hpp:955
definitionArguments * args
Definition ast.hpp:956
identifierWithDefTemplateArg & getName()
Definition ast.cpp:955
codeBlock * block
Definition ast.hpp:972
typeSpec & getResultType()
Definition ast.cpp:975
identifierWithTemplateArg & getName()
Definition ast.cpp:967
codeBlock & getBlock()
Definition ast.cpp:979
definitionArguments & getArgs()
Definition ast.cpp:971
typeSpec * resultType
Definition ast.hpp:971
definitionArguments * args
Definition ast.hpp:970
identifierWithTemplateArg * name
Definition ast.hpp:969
innerMethodDecl * method
Definition ast.hpp:649
innerMethodDecl & getMethod()
Definition ast.cpp:295
identifierWithTypeSpec & getVar()
Definition ast.cpp:287
identifierWithTypeSpec * var
Definition ast.hpp:644
vec< interfaceDefInnerPair * > & getInner()
Definition ast.cpp:299
vec< interfaceDefInnerPair * > inner
Definition ast.hpp:658
identifierWithDefTemplateArg * id
Definition ast.hpp:665
identifierWithDefTemplateArg & getId()
Definition ast.cpp:303
interfaceDefInner & getInner()
Definition ast.cpp:307
interfaceDefInner * inner
Definition ast.hpp:666
vec< rExpr * > & get()
Definition ast.cpp:39
vec< rExpr * > arg
Definition ast.hpp:306
codeBlock * block
Definition ast.hpp:242
typeSpec * resultType
Definition ast.hpp:241
vec< yoi::identifier * > captures
Definition ast.hpp:239
definitionArguments * args
Definition ast.hpp:240
rExpr * rhs
Definition ast.hpp:471
uniqueExpr & getLhs() const
Definition ast.cpp:127
lexer::token op
Definition ast.hpp:469
uniqueExpr * lhs
Definition ast.hpp:470
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:776
letAssignmentPairLHS & getLhs()
Definition ast.cpp:375
vec< letAssignmentPair * > & getTerms()
Definition ast.cpp:383
vec< letAssignmentPair * > terms
Definition ast.hpp:787
vec< lexer::token > ops
Definition ast.hpp:581
vec< lexer::token > & getOp()
Definition ast.cpp:239
vec< inclusiveExpr * > terms
Definition ast.hpp:580
vec< inclusiveExpr * > & getTerms()
Definition ast.cpp:235
vec< lexer::token > ops
Definition ast.hpp:593
vec< logicalAndExpr * > & getTerms()
Definition ast.cpp:247
vec< lexer::token > & getOp()
Definition ast.cpp:251
vec< logicalAndExpr * > terms
Definition ast.hpp:592
yoi::vec< marcoPair * > pairs
Definition ast.hpp:234
vec< subscriptExpr * > & getTerms()
Definition ast.cpp:95
vec< subscriptExpr * > terms
Definition ast.hpp:397
vec< leftExpr * > terms
Definition ast.hpp:484
vec< lexer::token > ops
Definition ast.hpp:485
vec< lexer::token > & getOp()
Definition ast.cpp:143
vec< leftExpr * > & getTerms()
Definition ast.cpp:139
invocationArguments * args
Definition ast.hpp:406
externModuleAccessExpression * type
Definition ast.hpp:404
lambdaExpr * lambda
Definition ast.hpp:430
enum yoi::primary::primaryKind kind
funcExpr * func
Definition ast.hpp:431
memberExpr * member
Definition ast.hpp:424
rExpr & getExpr() const
Definition ast.cpp:107
rExpr * expr
Definition ast.hpp:426
memberExpr & getMemberExpr() const
Definition ast.cpp:99
basicLiterals * literals
Definition ast.hpp:425
newExpression * newExpr
Definition ast.hpp:429
bracedInitalizerList * bracedInitalizer
Definition ast.hpp:432
basicLiterals & getLiterals() const
Definition ast.cpp:103
typeIdExpression * typeId
Definition ast.hpp:427
dynCastExpression * dynCast
Definition ast.hpp:428
logicalOrExpr * expr
Definition ast.hpp:604
logicalOrExpr & getExpr() const
Definition ast.cpp:259
vec< lexer::token > ops
Definition ast.hpp:521
vec< shiftExpr * > & getTerms()
Definition ast.cpp:175
vec< shiftExpr * > terms
Definition ast.hpp:520
vec< lexer::token > & getOp()
Definition ast.cpp:179
rExpr * value
Definition ast.hpp:899
rExpr & getValue()
Definition ast.cpp:455
bool hasValue() const
Definition ast.cpp:459
yoi::vec< externModuleAccessExpression * > emaes
Definition ast.hpp:1134
externModuleAccessExpression * emae
Definition ast.hpp:1129
vec< lexer::token > ops
Definition ast.hpp:509
vec< lexer::token > & getOp()
Definition ast.cpp:167
vec< addExpr * > terms
Definition ast.hpp:508
vec< addExpr * > & getTerms()
Definition ast.cpp:163
innerMethodDecl * method
Definition ast.hpp:683
innerMethodDecl & getMethod()
Definition ast.cpp:319
constructorDecl & getConstructor()
Definition ast.cpp:315
constructorDecl * con
Definition ast.hpp:681
identifierWithTypeSpec & getVar()
Definition ast.cpp:311
finalizerDecl * finalizer
Definition ast.hpp:685
finalizerDecl & getFinalizer()
Definition ast.cpp:1193
identifierWithTypeSpec * var
Definition ast.hpp:679
vec< structDefInnerPair * > & getInner()
Definition ast.cpp:323
vec< structDefInnerPair * > inner
Definition ast.hpp:698
structDefInner * inner
Definition ast.hpp:706
identifierWithDefTemplateArg * id
Definition ast.hpp:705
identifierWithDefTemplateArg & getId()
Definition ast.cpp:327
structDefInner & getInner()
Definition ast.cpp:331
vec< subscript * > & getSubscript()
Definition ast.cpp:1079
vec< subscript * > subscriptVal
Definition ast.hpp:388
bool isIdentifier() const
Definition ast.cpp:91
identifierWithTemplateArg * id
Definition ast.hpp:387
bool isInvocation() const
Definition ast.cpp:1075
rExpr & getExpr() const
Definition ast.cpp:63
rExpr * expr
Definition ast.hpp:351
bool isSubscript() const
Definition ast.cpp:1071
invocationArguments * args
Definition ast.hpp:352
typeSpec * spec
Definition ast.hpp:292
typeSpec & get() const
Definition ast.cpp:31
vec< templateArgSpec * > spec
Definition ast.hpp:299
vec< templateArgSpec * > & get()
Definition ast.cpp:35
rExpr * expr
Definition ast.hpp:1051
vec< catchParam * > catchParams
Definition ast.hpp:1064
codeBlock * tryBlock
Definition ast.hpp:1063
codeBlock * finallyBlock
Definition ast.hpp:1065
yoi::identifierWithDefTemplateArg * lhs
Definition ast.hpp:221
yoi::typeSpec * rhs
Definition ast.hpp:222
typeSpec * type
Definition ast.hpp:1070
decltypeExpr * decltypeExpression
Definition ast.hpp:340
yoi::vec< uint64_t > * arraySubscript
Definition ast.hpp:342
funcTypeSpec & getTypeSpec() const
Definition ast.cpp:59
externModuleAccessExpression * member
Definition ast.hpp:337
funcTypeSpec * func
Definition ast.hpp:338
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:457
lexer::token & getOp()
Definition ast.cpp:111
abstractExpr * lhs
Definition ast.hpp:458
vec< typeSpec * > types
Definition ast.hpp:1082
identifier * name
Definition ast.hpp:611
identifier & getName()
Definition ast.cpp:263
lexer::token path
Definition ast.hpp:612
lexer::token & getPath()
Definition ast.cpp:267
codeBlock * block
Definition ast.hpp:861
codeBlock & getBlock()
Definition ast.cpp:423
rExpr & getCond()
Definition ast.cpp:419
rExpr * cond
Definition ast.hpp:860
rExpr * expr
Definition ast.hpp:1099
std::vector< t > vec
Definition def.hpp:53
void finalizeAST(funcTypeSpec *ptr)
Definition ast.cpp:475
uint64_t indexT
Definition def.hpp:51
codeBlock * block
Definition ast.hpp:838
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:815
enumerationDefinition * enumerationDefVal
Definition ast.hpp:822
useStmt * useStmtVal
Definition ast.hpp:812
implStmt * implStmtVal
Definition ast.hpp:816
interfaceDefStmt * interfaceDefStmtVal
Definition ast.hpp:813
letStmt * letStmtVal
Definition ast.hpp:817
conceptDefinition * conceptDefVal
Definition ast.hpp:823
funcDefStmt * funcDefStmtVal
Definition ast.hpp:818
typeAliasStmt * typeAliasStmtVal
Definition ast.hpp:821
exportDecl * exportDeclVal
Definition ast.hpp:820
structDefStmt * structDefStmtVal
Definition ast.hpp:814
importDecl * importDeclVal
Definition ast.hpp:819
returnStmt * returnStmtVal
Definition ast.hpp:934
continueStmt * continueStmtVal
Definition ast.hpp:935