Gyoji Compiler
Loading...
Searching...
No Matches
tree.hpp
1/* Copyright 2025 Jonathan S. Arney
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * https://github.com/jarney/gyoji/blob/master/LICENSE
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15#ifndef _GYOJI_INTERNAL
16#error "This header is intended to be used internally as a part of the Gyoji front-end. Please include frontend.hpp instead."
17#endif
18#pragma once
19
20
32namespace Gyoji::frontend::tree {
34
45 public:
70
75 TerminalNonSyntax(Type _type, const Gyoji::context::Token & _token);
80
85 const Type &get_type() const;
90 const std::string & get_data() const;
91
92 private:
93 Type type;
94 const Gyoji::context::Token & token;
95 };
96
98
104 public:
141
146 Terminal(const Gyoji::context::Token & _token);
150 ~Terminal();
151
156 const Gyoji::context::TokenID & get_type() const;
161 const std::string & get_value() const;
162
168
176
180 std::string get_name() const;
181
182 const IdentifierType & get_identifier_type() const;
183 void set_identifier_type(IdentifierType _identifier_type);
184
185 // The terminal "owns" uniquely all of the non-syntax data
186 // in this vector. It may be returned to access it,
187 // but these are owned pointers, so they must only
188 // be de-referenced and never assigned to
190
191 void set_ns2_entity(Gyoji::frontend::namespaces::NS2Entity *_ns_entity);
192 Gyoji::frontend::namespaces::NS2Entity *get_ns2_entity() const;
193
194
195 private:
196 const Gyoji::context::Token & token;
197 std::string fully_qualified_name;
198 IdentifierType identifier_type;
199 // Tells us whether this is a namespace name, an entity, or what.
201 };
202
203
218 public:
219 typedef std::variant<
228 Gyoji::owned<FileStatementUsing>> FileStatementType;
229
230 FileStatement(FileStatementType _statement, const Gyoji::frontend::ast::SyntaxNode & _sn);
232
247 const FileStatementType & get_statement() const;
248
249 private:
250 FileStatementType statement;
251 };
252
254
312
314
322 public:
357 const AccessModifierType & get_type() const;
358 private:
360 Gyoji::owned<Terminal> modifier;
361 };
362
364
377 public:
397 bool is_unsafe() const;
398 private:
399 Gyoji::owned<Terminal> unsafe_token;
400 };
401
403
432 public:
438
444 TypeName(Gyoji::owned<Terminal> _typeof_token,
445 Gyoji::owned<Terminal> _paren_l_token,
446 Gyoji::owned<Expression> _expression,
447 Gyoji::owned<Terminal> _paren_r_token
448 );
452 ~TypeName();
473 bool is_expression() const;
479 std::string get_name() const;
480 const Gyoji::context::SourceReference & get_name_source_ref() const;
486 const Expression & get_expression() const;
487 private:
488 bool m_is_expression;
489 // For raw names
490 Gyoji::owned<Terminal> type_name;
491 // for typeof expressions
492 Gyoji::owned<Terminal> typeof_token;
493 Gyoji::owned<Terminal> paren_l_token;
494 Gyoji::owned<Expression> expression;
495 Gyoji::owned<Terminal> paren_r_token;
496 };
497
499
538
540
546 public:
551 Gyoji::owned<AccessQualifier> _access_qualifier,
552 Gyoji::owned<TypeName> _type_name
553 );
565 const TypeName & get_type_name() const;
566 private:
567 Gyoji::owned<AccessQualifier> access_qualifier;
568 Gyoji::owned<TypeName> type_name;
569 };
570
572
596 public:
598 Gyoji::owned<TypeSpecifier> _type_specifier,
599 Gyoji::owned<Terminal> _paren_l_token,
600 Gyoji::owned<TypeSpecifierCallArgs> _type_specifier_call_args,
601 Gyoji::owned<Terminal> _paren_r_token
602 );
610 const TypeSpecifier & get_type() const;
615 const TypeSpecifierCallArgs & get_args() const;
616
617 private:
618 Gyoji::owned<TypeSpecifier> type_specifier;
619 Gyoji::owned<Terminal> paren_l_token;
620 Gyoji::owned<TypeSpecifierCallArgs> type_specifier_call_args;
621 Gyoji::owned<Terminal> paren_r_token;
622 };
623
625
632 public:
646 Gyoji::owned<TypeSpecifier> _type_specifier,
647 Gyoji::owned<Terminal> _paren_l1_token,
648 Gyoji::owned<Terminal> _star_token,
649 Gyoji::owned<Terminal> _paren_r1_token,
650 Gyoji::owned<Terminal> _paren_l2_token,
651 Gyoji::owned<TypeSpecifierList> _function_definition_arg_list,
652 Gyoji::owned<Terminal> _paren_r2_token
653 );
661 const TypeSpecifier & get_return_type() const;
665 const TypeSpecifierList & get_args() const;
666 private:
667 Gyoji::owned<TypeSpecifier> type_specifier;
668 Gyoji::owned<Terminal> paren_l1_token;
669 Gyoji::owned<Terminal> star_token;
670 Gyoji::owned<Terminal> paren_r1_token;
671 Gyoji::owned<Terminal> paren_l2_token;
672 Gyoji::owned<TypeSpecifierList> type_specifier_list;
673 Gyoji::owned<Terminal> paren_r2_token;
674 };
675
702 public:
708 Gyoji::owned<TypeSpecifier> _type_specifier,
709 Gyoji::owned<Terminal> _star_token,
710 Gyoji::owned<AccessQualifier> _access_qualifier
711 );
716
720 const TypeSpecifier & get_type_specifier() const;
726 private:
727 Gyoji::owned<TypeSpecifier> type_specifier;
728 Gyoji::owned<Terminal> star_token;
729 Gyoji::owned<AccessQualifier> access_qualifier;
730 };
731
732 class TypeSpecifierArray : public Gyoji::frontend::ast::SyntaxNode {
733 public:
738 TypeSpecifierArray(
739 Gyoji::owned<TypeSpecifier> _type_specifier,
740 Gyoji::owned<Terminal> _bracket_l_token,
741 Gyoji::owned<Terminal> _literal_int_token,
742 Gyoji::owned<Terminal> _bracket_r_token
743 );
747 ~TypeSpecifierArray();
748
752 const TypeSpecifier & get_type_specifier() const;
753
758 const Terminal & get_literal_int_token() const;
759 private:
760 Gyoji::owned<TypeSpecifier> type_specifier;
761 Gyoji::owned<Terminal> bracket_l_token;
762 Gyoji::owned<Terminal> literal_int_token;
763 Gyoji::owned<Terminal> bracket_r_token;
764 };
765
793 public:
799 Gyoji::owned<TypeSpecifier> _type_specifier,
800 Gyoji::owned<Terminal> _andpersand_token,
801 Gyoji::owned<AccessQualifier> _access_qualifier
802 );
810 const TypeSpecifier & get_type_specifier() const;
817 private:
818 Gyoji::owned<TypeSpecifier> type_specifier;
819 Gyoji::owned<Terminal> andpersand_token;
820 Gyoji::owned<AccessQualifier> access_qualifier;
821 };
822
824
856 public:
857 typedef std::variant<
864 > TypeSpecifierType;
865 TypeSpecifier(TypeSpecifier::TypeSpecifierType _type, const Gyoji::frontend::ast::SyntaxNode & _sn);
873 const TypeSpecifier::TypeSpecifierType & get_type() const;
874 private:
875 TypeSpecifier::TypeSpecifierType type;
876 };
877
879
887 public:
889 Gyoji::owned<Terminal> _identifier_token
890 );
898 const TypeSpecifier & get_type_specifier() const;
902 const Terminal & get_identifier() const;
903 private:
904 Gyoji::owned<TypeSpecifier> type_specifier;
905 Gyoji::owned<Terminal> identifier_token;
906 };
907
909
939
941
971
972
974
983 public:
986 Gyoji::owned<Terminal> _paren_l,
988 Gyoji::owned<Terminal> _paren_r,
989 Gyoji::owned<Terminal> _semicolon
990 );
998 const AccessModifier & get_access_modifier() const;
1003 const UnsafeModifier & get_unsafe_modifier() const;
1004
1005 bool is_destructor() const;
1006
1011 const TypeSpecifier & get_return_type() const;
1015 const Terminal & get_name() const;
1021
1022 private:
1024 Gyoji::owned<Terminal> paren_l; // argument list delimiter PAREN_L
1026 Gyoji::owned<Terminal> paren_r; // argument list delimiter PAREN_R
1027 Gyoji::owned<Terminal> semicolon; // argument list delimiter SEMICOLON
1028 };
1029
1030 class InitializerExpression : public Gyoji::frontend::ast::SyntaxNode {
1031 public:
1032 InitializerExpression(
1033 const Gyoji::context::SourceReference & _src_ref
1034 );
1035 InitializerExpression(
1036 Gyoji::owned<Terminal> _equals_token,
1037 Gyoji::owned<Expression> _expression
1038 );
1039 InitializerExpression(
1040 Gyoji::owned<Terminal> _equals_token,
1041 Gyoji::owned<StructInitializerExpression> _struct_initializer_expression
1042 );
1043 ~InitializerExpression();
1044 bool has_expression() const;
1045 bool has_struct_expression() const;
1046 const Expression & get_expression() const;
1047 const StructInitializerExpression & get_struct_initializer_expression() const;
1048 private:
1049 Gyoji::owned<Terminal> equals_token;
1050 Gyoji::owned<Expression> expression;
1051 Gyoji::owned<StructInitializerExpression> struct_initializer_expression;
1052 };
1053
1054 class StructInitializerExpression : public Gyoji::frontend::ast::SyntaxNode {
1055 public:
1056 StructInitializerExpression(
1057 Gyoji::owned<Terminal> _brace_l_token,
1059 Gyoji::owned<Terminal> _brace_r_token
1060 );
1061 ~StructInitializerExpression();
1062 const StructInitializerFieldList & get_field_list() const;
1063 private:
1064 Gyoji::owned<Terminal> brace_l_token;
1066 Gyoji::owned<Terminal> brace_r_token;
1067
1068 };
1069
1070 class StructInitializerFieldList : public Gyoji::frontend::ast::SyntaxNode {
1071 public:
1072 StructInitializerFieldList(const Gyoji::context::SourceReference & _source_ref);
1073 ~StructInitializerFieldList();
1076 private:
1078 };
1079
1080 class StructInitializerFieldExpression : public Gyoji::frontend::ast::SyntaxNode {
1081 public:
1082 StructInitializerFieldExpression(
1083 Gyoji::owned<Terminal> _dot_token,
1084 Gyoji::owned<Terminal> _identifier_token,
1085 Gyoji::owned<Terminal> _assignment_token,
1086 Gyoji::owned<Expression> _expression,
1087 Gyoji::owned<Terminal> _semicolon_token
1088 );
1089 ~StructInitializerFieldExpression();
1090 const Terminal & get_identifier() const;
1091 const Expression & get_expression() const;
1092 private:
1093 Gyoji::owned<Terminal> dot_token;
1094 Gyoji::owned<Terminal> identifier_token;
1095 Gyoji::owned<Terminal> assignment_token;
1096 Gyoji::owned<Expression> expression;
1097 Gyoji::owned<Terminal> semicolon_token;
1098 };
1099
1101
1116 public:
1122 Gyoji::owned<TypeSpecifier> _type_specifier,
1123 Gyoji::owned<Terminal> _identifier_token,
1125 Gyoji::owned<Terminal> _semicolon_token
1126 );
1127
1135 const TypeSpecifier & get_type_specifier() const;
1139 const Terminal & get_identifier() const;
1140
1145 const InitializerExpression & get_initializer_expression() const;
1146
1147 private:
1148 Gyoji::owned<TypeSpecifier> type_specifier;
1149 Gyoji::owned<Terminal> identifier_token;
1150 Gyoji::owned<ArrayLength> array_length;
1152 Gyoji::owned<Terminal> semicolon_token;
1153 };
1154
1156
1178 public:
1184 Gyoji::owned<UnsafeModifier> _unsafe_modifier,
1185 Gyoji::owned<ScopeBody> _scope_body
1186 );
1195 const UnsafeModifier & get_unsafe_modifier() const;
1200 const ScopeBody & get_scope_body() const;
1201 private:
1202 Gyoji::owned<UnsafeModifier> unsafe_modifier;
1203 Gyoji::owned<ScopeBody> scope_body;
1204 };
1205
1207
1222 public:
1224 Gyoji::owned<Expression> _expression,
1225 Gyoji::owned<Terminal> _semicolon_token
1226 );
1231 const Expression & get_expression() const;
1232 private:
1233 Gyoji::owned<Expression> expression;
1234 Gyoji::owned<Terminal> semicolon_token;
1235 };
1236
1238
1293 public:
1299 Gyoji::owned<Terminal> _if_token,
1300 Gyoji::owned<Terminal> _paren_l_token,
1301 Gyoji::owned<Expression> _expression,
1302 Gyoji::owned<Terminal> _paren_r_token,
1303 Gyoji::owned<ScopeBody> _if_scope_body
1304 );
1311 Gyoji::owned<Terminal> _if_token,
1312 Gyoji::owned<Terminal> _paren_l_token,
1313 Gyoji::owned<Expression> _expression,
1314 Gyoji::owned<Terminal> _paren_r_token,
1315 Gyoji::owned<ScopeBody> _if_scope_body,
1316 Gyoji::owned<Terminal> _else_token,
1317 Gyoji::owned<ScopeBody> _else_scope_body
1318 );
1325 Gyoji::owned<Terminal> _if_token,
1326 Gyoji::owned<Terminal> _paren_l_token,
1327 Gyoji::owned<Expression> _expression,
1328 Gyoji::owned<Terminal> _paren_r_token,
1329 Gyoji::owned<ScopeBody> _if_scope_body,
1330 Gyoji::owned<Terminal> _else_token,
1331 Gyoji::owned<StatementIfElse> _statement_if_else
1332 );
1343 const Expression & get_expression() const;
1344
1349 const ScopeBody & get_if_scope_body() const;
1350
1357 const StatementIfElse & get_else_if() const;
1363 const ScopeBody & get_else_scope_body() const;
1364 bool has_else() const;
1365 bool has_else_if() const;
1366 private:
1367 bool m_has_else;
1368 bool m_has_else_if;
1369 Gyoji::owned<Terminal> if_token;
1370 Gyoji::owned<Terminal> paren_l_token;
1371 Gyoji::owned<Expression> expression;
1372 Gyoji::owned<Terminal> paren_r_token;
1373 Gyoji::owned<ScopeBody> if_scope_body;
1374 Gyoji::owned<Terminal> else_token;
1375 Gyoji::owned<ScopeBody> else_scope_body;
1377 };
1378
1380
1396 public:
1398 Gyoji::owned<Terminal> _while_token,
1399 Gyoji::owned<Terminal> _paren_l_token,
1400 Gyoji::owned<Expression> _expression,
1401 Gyoji::owned<Terminal> _paren_r_token,
1402 Gyoji::owned<ScopeBody> _scope_body
1403 );
1414 const Expression & get_expression() const;
1415 const ScopeBody & get_scope_body() const;
1416 private:
1417 Gyoji::owned<Terminal> while_token;
1418 Gyoji::owned<Terminal> paren_l_token;
1419 Gyoji::owned<Expression> expression;
1420 Gyoji::owned<Terminal> paren_r_token;
1421 Gyoji::owned<ScopeBody> scope_body;
1422 };
1423
1424 class StatementFor : public Gyoji::frontend::ast::SyntaxNode {
1425 public:
1426 StatementFor(
1427 Gyoji::owned<Terminal> _for_token,
1428 Gyoji::owned<Terminal> _paren_l_token,
1429 Gyoji::owned<Expression> _expression_initial,
1430 Gyoji::owned<Terminal> _semicolon_initial,
1431 Gyoji::owned<Expression> _expression_termination,
1432 Gyoji::owned<Terminal> _semicolon_termination,
1433 Gyoji::owned<Expression> _expression_increment,
1434 Gyoji::owned<Terminal> _paren_r_token,
1435 Gyoji::owned<ScopeBody> _scope_body
1436 );
1437 StatementFor(
1438 Gyoji::owned<Terminal> _for_token,
1439 Gyoji::owned<Terminal> _paren_l_token,
1440 Gyoji::owned<TypeSpecifier> _type_specifier,
1441 Gyoji::owned<Terminal> _identifier_token,
1442 Gyoji::owned<Terminal> _assignment_token,
1443 Gyoji::owned<Expression> _expression_initial,
1444 Gyoji::owned<Terminal> _semicolon_initial,
1445 Gyoji::owned<Expression> _expression_termination,
1446 Gyoji::owned<Terminal> _semicolon_termination,
1447 Gyoji::owned<Expression> _expression_increment,
1448 Gyoji::owned<Terminal> _paren_r_token,
1449 Gyoji::owned<ScopeBody> _scope_body
1450 );
1454 ~StatementFor();
1455 bool is_declaration() const;
1456
1460 const TypeSpecifier & get_type_specifier() const;
1461
1465 const Terminal & get_identifier() const;
1466
1467 const Expression & get_expression_initial() const;
1468 const Expression & get_expression_termination() const;
1469 const Expression & get_expression_increment() const;
1470 const ScopeBody & get_scope_body() const;
1471 private:
1472 bool is_declaration_initializer;
1473 Gyoji::owned<Terminal> for_token;
1474 Gyoji::owned<Terminal> paren_l_token;
1475 Gyoji::owned<TypeSpecifier> type_specifier;
1476 Gyoji::owned<Terminal> identifier_token;
1477 Gyoji::owned<Terminal> assignment_token;
1478 Gyoji::owned<Expression> expression_initial;
1479 Gyoji::owned<Terminal> semicolon_initial;
1480 Gyoji::owned<Expression> expression_termination;
1481 Gyoji::owned<Terminal> semicolon_termination;
1482 Gyoji::owned<Expression> expression_increment;
1483 Gyoji::owned<Terminal> paren_r_token;
1484 Gyoji::owned<ScopeBody> scope_body;
1485 };
1486
1487 class StatementSwitchBlock : public Gyoji::frontend::ast::SyntaxNode {
1488 public:
1489 StatementSwitchBlock(
1490 Gyoji::owned<Terminal> _default_token,
1491 Gyoji::owned<Terminal> _colon_token,
1492 Gyoji::owned<ScopeBody> _scope_body
1493 );
1494 StatementSwitchBlock(
1495 Gyoji::owned<Terminal> _case_token,
1496 Gyoji::owned<Expression> _expression,
1497 Gyoji::owned<Terminal> _colon_token,
1498 Gyoji::owned<ScopeBody> _scope_body
1499 );
1503 ~StatementSwitchBlock();
1504 bool is_default() const;
1505 const Expression & get_expression();
1506 const ScopeBody & get_scope_body();
1507 private:
1508 bool m_is_default;
1509 // For the default case
1510 Gyoji::owned<Terminal> default_token;
1511 // For the expression case
1512 Gyoji::owned<Terminal> case_token;
1513 Gyoji::owned<Expression> expression;
1514 // Common:
1515 Gyoji::owned<Terminal> colon_token;
1516 Gyoji::owned<ScopeBody> scope_body;
1517 };
1518
1519 class StatementSwitchContent : public Gyoji::frontend::ast::SyntaxNode {
1520 public:
1521 StatementSwitchContent(const Gyoji::context::SourceReference & _source_ref);
1525 ~StatementSwitchContent();
1526 const std::vector<Gyoji::owned<StatementSwitchBlock>> & get_blocks() const;
1527 void add_block(Gyoji::owned<StatementSwitchBlock> _block);
1528 private:
1530 };
1531
1532 class StatementSwitch : public Gyoji::frontend::ast::SyntaxNode {
1533 public:
1534 StatementSwitch(
1535 Gyoji::owned<Terminal> _switch_token,
1536 Gyoji::owned<Terminal> _paren_l_token,
1537 Gyoji::owned<Expression> expression,
1538 Gyoji::owned<Terminal> _paren_r_token,
1539 Gyoji::owned<Terminal> _brace_l_token,
1541 Gyoji::owned<Terminal> _brace_r_token
1542 );
1546 ~StatementSwitch();
1547 const Expression & get_expression() const;
1548 const StatementSwitchContent & get_switch_content() const;
1549 private:
1550 Gyoji::owned<Terminal> switch_token;
1551 Gyoji::owned<Terminal> paren_l_token;
1552 Gyoji::owned<Expression> expression;
1553 Gyoji::owned<Terminal> paren_r_token;
1554 Gyoji::owned<Terminal> brace_l_token;
1556 Gyoji::owned<Terminal> brace_r_token;
1557 };
1558 class StatementLabel : public Gyoji::frontend::ast::SyntaxNode {
1559 public:
1560 StatementLabel(
1561 Gyoji::owned<Terminal> _label_token,
1562 Gyoji::owned<Terminal> _identifier_token,
1563 Gyoji::owned<Terminal> _colon_token
1564 );
1568 ~StatementLabel();
1569 const std::string & get_name() const;
1570 const Gyoji::context::SourceReference & get_name_source_ref() const;
1571 private:
1572 Gyoji::owned<Terminal> label_token;
1573 Gyoji::owned<Terminal> identifier_token;
1574 Gyoji::owned<Terminal> colon_token;
1575 };
1576 class StatementGoto : public Gyoji::frontend::ast::SyntaxNode {
1577 public:
1578 StatementGoto(
1579 Gyoji::owned<Terminal> _goto_token,
1580 Gyoji::owned<Terminal> _identifier_token,
1581 Gyoji::owned<Terminal> _semicolon_token
1582 );
1586 ~StatementGoto();
1587 const std::string & get_label() const;
1588 const Gyoji::context::SourceReference & get_label_source_ref() const;
1589 private:
1590 Gyoji::owned<Terminal> goto_token;
1591 Gyoji::owned<Terminal> identifier_token;
1592 Gyoji::owned<Terminal> semicolon_token;
1593 };
1594 class StatementBreak : public Gyoji::frontend::ast::SyntaxNode {
1595 public:
1596 StatementBreak(
1597 Gyoji::owned<Terminal> _break_token,
1598 Gyoji::owned<Terminal> _semicolon_token
1599 );
1603 ~StatementBreak();
1604 private:
1605 Gyoji::owned<Terminal> break_token;
1606 Gyoji::owned<Terminal> semicolon_token;
1607 };
1608 class StatementContinue : public Gyoji::frontend::ast::SyntaxNode {
1609 public:
1610 StatementContinue(
1611 Gyoji::owned<Terminal> _continue_token,
1612 Gyoji::owned<Terminal> _semicolon_token
1613 );
1617 ~StatementContinue();
1618 private:
1619 Gyoji::owned<Terminal> continue_token;
1620 Gyoji::owned<Terminal> semicolon_token;
1621 };
1622 class StatementReturn : public Gyoji::frontend::ast::SyntaxNode {
1623 public:
1627 StatementReturn(
1628 Gyoji::owned<Terminal> _return_token,
1629 Gyoji::owned<Expression> _expression,
1630 Gyoji::owned<Terminal> _semicolon_token
1631 );
1635 StatementReturn(
1636 Gyoji::owned<Terminal> _return_token,
1637 Gyoji::owned<Terminal> _semicolon_token
1638 );
1642 ~StatementReturn();
1643 bool is_void() const;
1644 const Expression & get_expression() const;
1645 private:
1646 Gyoji::owned<Terminal> return_token;
1647 bool void_return;
1648 Gyoji::owned<Expression> expression;
1649 Gyoji::owned<Terminal> semicolon_token;
1650 };
1651
1652 class Statement : public Gyoji::frontend::ast::SyntaxNode {
1653 public:
1654 typedef std::variant<
1667 > StatementType;
1668
1669 Statement(StatementType _statement, const SyntaxNode & _sn);
1673 ~Statement();
1674 const StatementType & get_statement() const;
1675 private:
1676 StatementType statement;
1677 };
1678
1679 class StatementList : public Gyoji::frontend::ast::SyntaxNode {
1680 public:
1681 StatementList(const Gyoji::context::SourceReference & _source_ref);
1685 ~StatementList();
1686 void add_statement(Gyoji::owned<Statement> _statement);
1687 const std::vector<Gyoji::owned<Statement>> &get_statements() const;
1688 private:
1690 };
1691
1692 class ScopeBody : public Gyoji::frontend::ast::SyntaxNode {
1693 public:
1694 ScopeBody(
1695 Gyoji::owned<Terminal> brace_l_token,
1696 Gyoji::owned<StatementList> statement_list,
1697 Gyoji::owned<Terminal> brace_r_token
1698 );
1702 ~ScopeBody();
1703 const StatementList & get_statements() const;
1704 const Gyoji::context::SourceReference & get_end_source_ref() const;
1705 private:
1706 Gyoji::owned<Terminal> brace_l_token;
1707 Gyoji::owned<StatementList> statement_list;
1708 Gyoji::owned<Terminal> brace_r_token;
1709 };
1710
1711 class FileStatementFunctionDeclStart : public Gyoji::frontend::ast::SyntaxNode {
1712 public:
1713 FileStatementFunctionDeclStart(
1714 Gyoji::owned<AccessModifier> _access_modifier,
1715 Gyoji::owned<UnsafeModifier> _unsafe_modifier,
1716 Gyoji::owned<TypeSpecifier> _type_specifier,
1718 );
1719 FileStatementFunctionDeclStart(
1720 Gyoji::owned<AccessModifier> _access_modifier,
1721 Gyoji::owned<UnsafeModifier> _unsafe_modifier,
1723 );
1724 ~FileStatementFunctionDeclStart();
1725
1726 const AccessModifier & get_access_modifier() const;
1727 const UnsafeModifier & get_unsafe_modifier() const;
1728 const TypeSpecifier & get_type_specifier() const;
1729 bool is_destructor() const;
1730 const Terminal & get_name() const;
1731 private:
1732 Gyoji::owned<AccessModifier> access_modifier;
1733 Gyoji::owned<UnsafeModifier> unsafe_modifier;
1734 bool m_is_destructor;
1735 Gyoji::owned<TypeSpecifier> type_specifier;
1736 Gyoji::owned<Terminal> name; // function name (IDENTIFIER)
1737 };
1738
1739 class FileStatementFunctionDefinition : public Gyoji::frontend::ast::SyntaxNode {
1740 public:
1741 FileStatementFunctionDefinition(
1743 Gyoji::owned<Terminal> _paren_l,
1745 Gyoji::owned<Terminal> _paren_r,
1746 Gyoji::owned<ScopeBody> _scope_body
1747 );
1751 ~FileStatementFunctionDefinition();
1752 const AccessModifier & get_access_modifier() const;
1753 const UnsafeModifier & get_unsafe_modifier() const;
1754 bool is_destructor() const;
1758 const TypeSpecifier & get_return_type() const;
1759 const Terminal & get_name() const;
1760 const FunctionDefinitionArgList & get_arguments() const;
1761
1762 const ScopeBody & get_scope_body() const;
1763
1764 private:
1766 Gyoji::owned<Terminal> paren_l; // argument list delimiter PAREN_L
1768 Gyoji::owned<Terminal> paren_r; // argument list delimiter PAREN_R
1769 Gyoji::owned<ScopeBody> scope_body; // argument list delimiter SEMICOLON
1770 };
1771
1772 class ArrayLength : public Gyoji::frontend::ast::SyntaxNode {
1773 public:
1774 ArrayLength(const Gyoji::context::SourceReference & _source_ref);
1775 ArrayLength(
1776 Gyoji::owned<Terminal> _bracket_l_token,
1777 Gyoji::owned<Terminal> _literal_int_token,
1778 Gyoji::owned<Terminal> _bracket_r_token
1779 );
1783 ~ArrayLength();
1784 bool is_array() const;
1785 size_t get_size() const;
1786 const Gyoji::context::SourceReference & get_size_source_ref() const;
1787 private:
1788 Gyoji::owned<Terminal> bracket_l_token;
1789 Gyoji::owned<Terminal> literal_int_token;
1790 Gyoji::owned<Terminal> bracket_r_token;
1791 };
1792
1793 class ClassDeclStart : public Gyoji::frontend::ast::SyntaxNode {
1794 public:
1795 ClassDeclStart(
1796 Gyoji::owned<AccessModifier> _access_modifier,
1797 Gyoji::owned<Terminal> _class_token,
1798 Gyoji::owned<Terminal> _identifier_token,
1799 Gyoji::owned<ClassArgumentList> _class_argument_list
1800 );
1801
1805 ~ClassDeclStart();
1806 const AccessModifier & get_access_modifier() const;
1807 const Terminal & get_identifier() const;
1808 const Gyoji::context::SourceReference & get_name_source_ref() const;
1809
1810 const ClassArgumentList & get_argument_list() const;
1811 private:
1812 Gyoji::owned<AccessModifier> access_modifier;
1813 Gyoji::owned<Terminal> class_token;
1814 Gyoji::owned<Terminal> identifier_token;
1815 Gyoji::owned<ClassArgumentList> class_argument_list;
1816 };
1817 class ClassArgumentList : public Gyoji::frontend::ast::SyntaxNode {
1818 public:
1819 ClassArgumentList(const Gyoji::context::SourceReference & _source_ref);
1820 ClassArgumentList(Gyoji::owned<Terminal> _argument);
1824 ~ClassArgumentList();
1825 void add_argument(Gyoji::owned<Terminal> _comma, Gyoji::owned<Terminal> _argument);
1826 void add_parens(Gyoji::owned<Terminal> _paren_l, Gyoji::owned<Terminal> _paren_r);
1827 const std::vector<Gyoji::owned<Terminal>> & get_arguments() const;
1828 private:
1829 Gyoji::owned<Terminal> paren_l;
1832 Gyoji::owned<Terminal> paren_r;
1833 };
1834
1835 class ClassMemberDeclarationVariable : public Gyoji::frontend::ast::SyntaxNode {
1836 public:
1837 ClassMemberDeclarationVariable(
1838 Gyoji::owned<AccessModifier> _access_modifier,
1839 Gyoji::owned<UnsafeModifier> _unsafe_modifier,
1840 Gyoji::owned<TypeSpecifier> _type_specifier,
1841 Gyoji::owned<Terminal> _identifier_token,
1842 Gyoji::owned<Terminal> _semicolon_token
1843 );
1847 ~ClassMemberDeclarationVariable();
1848 const AccessModifier & get_access_modifier() const;
1849 const UnsafeModifier & get_unsafe_modifier() const;
1850 const TypeSpecifier & get_type_specifier() const;
1851 std::string get_name() const;
1852 const Gyoji::context::SourceReference & get_name_source_ref() const;
1853 private:
1854 Gyoji::owned<AccessModifier> access_modifier;
1855 Gyoji::owned<UnsafeModifier> unsafe_modifier;
1856 Gyoji::owned<TypeSpecifier> type_specifier;
1857 Gyoji::owned<Terminal> identifier_token;
1858 Gyoji::owned<Terminal> semicolon_token;
1859 };
1860 class ClassMemberDeclarationMethod : public Gyoji::frontend::ast::SyntaxNode {
1861 public:
1862 ClassMemberDeclarationMethod(
1863 Gyoji::owned<AccessModifier> _access_modifier,
1864 Gyoji::owned<UnsafeModifier> _unsafe_modifier,
1865 Gyoji::owned<TypeSpecifier> _type_specifier,
1866 Gyoji::owned<Terminal> _identifier_token,
1867 Gyoji::owned<Terminal> _paren_l_token,
1868 Gyoji::owned<FunctionDefinitionArgList> _function_definition_arg_list,
1869 Gyoji::owned<Terminal> _paren_r_token,
1870 Gyoji::owned<Terminal> _semicolon_token
1871 );
1875 ~ClassMemberDeclarationMethod();
1876 const AccessModifier & get_access_modifier() const;
1877 const UnsafeModifier & get_unsafe_modifier() const;
1878 const TypeSpecifier & get_type_specifier() const;
1879 const Terminal & get_identifier() const;
1880 const FunctionDefinitionArgList & get_arguments() const;
1881 private:
1882 Gyoji::owned<AccessModifier> access_modifier;
1883 Gyoji::owned<UnsafeModifier> unsafe_modifier;
1884 Gyoji::owned<TypeSpecifier> type_specifier;
1885 Gyoji::owned<Terminal> identifier_token;
1886 Gyoji::owned<Terminal> paren_l_token;
1887 Gyoji::owned<FunctionDefinitionArgList> function_definition_arg_list;
1888 Gyoji::owned<Terminal> paren_r_token;
1889 Gyoji::owned<Terminal> semicolon_token;
1890 };
1891 class ClassMemberDeclarationMethodStatic : public Gyoji::frontend::ast::SyntaxNode {
1892 public:
1893 ClassMemberDeclarationMethodStatic(
1894 Gyoji::owned<Terminal> _static_token,
1895 Gyoji::owned<AccessModifier> _access_modifier,
1896 Gyoji::owned<UnsafeModifier> _unsafe_modifier,
1897 Gyoji::owned<TypeSpecifier> _type_specifier,
1898 Gyoji::owned<Terminal> _identifier_token,
1899 Gyoji::owned<Terminal> _paren_l_token,
1900 Gyoji::owned<FunctionDefinitionArgList> _function_definition_arg_list,
1901 Gyoji::owned<Terminal> _paren_r_token,
1902 Gyoji::owned<Terminal> _semicolon_token
1903 );
1907 ~ClassMemberDeclarationMethodStatic();
1908 const AccessModifier & get_access_modifier() const;
1909 const UnsafeModifier & get_unsafe_modifier() const;
1910 const TypeSpecifier & get_type_specifier() const;
1911 const Terminal & get_identifier() const;
1912 const FunctionDefinitionArgList & get_arguments() const;
1913 private:
1914 Gyoji::owned<Terminal> static_token;
1915 Gyoji::owned<AccessModifier> access_modifier;
1916 Gyoji::owned<UnsafeModifier> unsafe_modifier;
1917 Gyoji::owned<TypeSpecifier> type_specifier;
1918 Gyoji::owned<Terminal> identifier_token;
1919 Gyoji::owned<Terminal> paren_l_token;
1920 Gyoji::owned<FunctionDefinitionArgList> function_definition_arg_list;
1921 Gyoji::owned<Terminal> paren_r_token;
1922 Gyoji::owned<Terminal> semicolon_token;
1923 };
1924 class ClassMemberDeclarationDestructor : public Gyoji::frontend::ast::SyntaxNode {
1925 public:
1926 ClassMemberDeclarationDestructor(
1927 Gyoji::owned<AccessModifier> _access_modifier,
1928 Gyoji::owned<UnsafeModifier> _unsafe_modifier,
1929 Gyoji::owned<Terminal> _tilde_token,
1930 Gyoji::owned<TypeSpecifier> _type_specifier,
1931 Gyoji::owned<Terminal> _paren_l_token,
1932 Gyoji::owned<FunctionDefinitionArgList> _function_definition_arg_list,
1933 Gyoji::owned<Terminal> _paren_r_token,
1934 Gyoji::owned<Terminal> _semicolon_token
1935 );
1939 ~ClassMemberDeclarationDestructor();
1940 const AccessModifier & get_access_modifier() const;
1941 const UnsafeModifier & get_unsafe_modifier() const;
1942 const TypeSpecifier & get_type_specifier() const;
1943 const FunctionDefinitionArgList & get_arguments() const;
1944 private:
1945 Gyoji::owned<AccessModifier> access_modifier;
1946 Gyoji::owned<UnsafeModifier> unsafe_modifier;
1947 Gyoji::owned<Terminal> tilde_token;
1948 Gyoji::owned<TypeSpecifier> type_specifier;
1949 Gyoji::owned<Terminal> paren_l_token;
1950 Gyoji::owned<FunctionDefinitionArgList> function_definition_arg_list;
1951 Gyoji::owned<Terminal> paren_r_token;
1952 Gyoji::owned<Terminal> semicolon_token;
1953 };
1954
1955 class ClassMemberDeclaration : public Gyoji::frontend::ast::SyntaxNode {
1956 public:
1957 typedef std::variant<
1966 > MemberType;
1967 ClassMemberDeclaration(
1968 MemberType _member,
1970 );
1974 ~ClassMemberDeclaration();
1975 const ClassMemberDeclaration::MemberType & get_member();
1976 private:
1977 MemberType member;
1978 };
1979
1980 class ClassMemberDeclarationList : public Gyoji::frontend::ast::SyntaxNode {
1981 public:
1982 ClassMemberDeclarationList(const Gyoji::context::SourceReference & _source_ref);
1986 ~ClassMemberDeclarationList();
1987 const std::vector<Gyoji::owned<ClassMemberDeclaration>> & get_members() const;
1988 void add_member(Gyoji::owned<ClassMemberDeclaration> _member);
1989 private:
1991 };
1992
1998 public:
2000 Gyoji::owned<ClassDeclStart> _class_decl_start,
2001 Gyoji::owned<Terminal> _semicolon_token
2002 );
2007 const AccessModifier & get_access_modifier() const;
2008
2009 std::string get_name() const;
2010 std::string get_fully_qualified_name() const;
2011 const Gyoji::context::SourceReference & get_name_source_ref() const;
2012
2013 const ClassArgumentList & get_argument_list() const;
2014 private:
2015 Gyoji::owned<ClassDeclStart> class_decl_start;
2016 Gyoji::owned<Terminal> semicolon_token;
2017 };
2018
2019 class ClassDefinition : public Gyoji::frontend::ast::SyntaxNode {
2020 public:
2021 ClassDefinition(
2022 Gyoji::owned<ClassDeclStart> _class_decl_start,
2023 Gyoji::owned<Terminal> _brace_l_token,
2024 Gyoji::owned<ClassMemberDeclarationList> _class_member_declaration_list,
2025 Gyoji::owned<Terminal> _brace_r_token,
2026 Gyoji::owned<Terminal> _semicolon_token
2027 );
2031 ~ClassDefinition();
2032 const AccessModifier & get_access_modifier() const;
2033 std::string get_name() const;
2034 std::string get_fully_qualified_name() const;
2035 const Gyoji::context::SourceReference & get_name_source_ref() const;
2036 const ClassArgumentList & get_argument_list() const;
2037 const std::vector<Gyoji::owned<ClassMemberDeclaration>> & get_members() const;
2038 private:
2039 Gyoji::owned<ClassDeclStart> class_decl_start;
2040 Gyoji::owned<Terminal> brace_l_token;
2041 Gyoji::owned<ClassMemberDeclarationList> class_member_declaration_list;
2042 Gyoji::owned<Terminal> brace_r_token;
2043 Gyoji::owned<Terminal> semicolon_token;
2044 };
2045
2046 class TypeDefinition : public Gyoji::frontend::ast::SyntaxNode {
2047 public:
2048 TypeDefinition(
2049 Gyoji::owned<AccessModifier> _access_modifier,
2050 Gyoji::owned<Terminal> _typedef_token,
2051 Gyoji::owned<TypeSpecifier> _type_specifier,
2052 Gyoji::owned<Terminal> _identifier_token,
2053 Gyoji::owned<Terminal> _semicolon_token
2054 );
2058 ~TypeDefinition();
2059 const AccessModifier & get_access_modifier() const;
2060 const std::string & get_name() const;
2061 const Gyoji::context::SourceReference & get_name_source_ref() const;
2062 const TypeSpecifier & get_type_specifier() const;
2063 private:
2064 Gyoji::owned<AccessModifier> access_modifier;
2065 Gyoji::owned<Terminal> typedef_token;
2066 Gyoji::owned<TypeSpecifier> type_specifier;
2067 Gyoji::owned<Terminal> identifier_token;
2068 Gyoji::owned<Terminal> semicolon_token;
2069 };
2070
2071 class EnumDefinitionValue : public Gyoji::frontend::ast::SyntaxNode {
2072 public:
2073 EnumDefinitionValue(
2074 Gyoji::owned<Terminal> _identifier_token,
2075 Gyoji::owned<Terminal> _equals_token,
2076 Gyoji::owned<Expression> _expression_primary,
2077 Gyoji::owned<Terminal> _semicolon_token
2078 );
2082 ~EnumDefinitionValue();
2083 const std::string & get_name() const;
2084 const Gyoji::context::SourceReference & get_name_source_ref() const;
2085 const Expression & get_expression() const;
2086 private:
2087 Gyoji::owned<Terminal> identifier_token;
2088 Gyoji::owned<Terminal> equals_token;
2089 Gyoji::owned<Expression> expression_primary;
2090 Gyoji::owned<Terminal> semicolon_token;
2091 };
2092
2093 class EnumDefinitionValueList : public Gyoji::frontend::ast::SyntaxNode {
2094 public:
2095 EnumDefinitionValueList(const Gyoji::context::SourceReference & _source_ref);
2099 ~EnumDefinitionValueList();
2100 void add_value(Gyoji::owned<EnumDefinitionValue>);
2101 const std::vector<Gyoji::owned<EnumDefinitionValue>> &get_values() const;
2102 private:
2104 };
2105
2106 class EnumDefinition : public Gyoji::frontend::ast::SyntaxNode {
2107 public:
2108 EnumDefinition(
2109 Gyoji::owned<AccessModifier> _access_modifier,
2110 Gyoji::owned<Terminal> _enum_token,
2111 Gyoji::owned<Terminal> _type_name_token,
2112 Gyoji::owned<Terminal> _identifier_token,
2113 Gyoji::owned<Terminal> _brace_l_token,
2115 Gyoji::owned<Terminal> _brace_r_token,
2116 Gyoji::owned<Terminal> _semicolon_token
2117 );
2121 ~EnumDefinition();
2122 const AccessModifier & get_access_modifier() const;
2123 const std::string & get_type_name() const;
2124 const Gyoji::context::SourceReference & get_type_name_source_ref() const;
2125
2126 const std::string & get_name() const;
2127 const Gyoji::context::SourceReference & get_name_source_ref() const;
2128
2129 const EnumDefinitionValueList & get_value_list() const;
2130 private:
2131 Gyoji::owned<AccessModifier> access_modifier;
2132 Gyoji::owned<Terminal> enum_token;
2133 Gyoji::owned<Terminal> type_name_token;
2134 Gyoji::owned<Terminal> identifier_token;
2135 Gyoji::owned<Terminal> brace_l_token;
2137 Gyoji::owned<Terminal> brace_r_token;
2138 Gyoji::owned<Terminal> semicolon_token;
2139
2140 };
2141
2142 class ExpressionPrimaryIdentifier : public Gyoji::frontend::ast::SyntaxNode {
2143 public:
2144 ExpressionPrimaryIdentifier(Gyoji::owned<Terminal> _identifier_token);
2148 ~ExpressionPrimaryIdentifier();
2149 const Terminal & get_identifier() const;
2150 private:
2151 Gyoji::owned<Terminal> identifier_token;
2152 };
2153 class ExpressionPrimaryNested : public Gyoji::frontend::ast::SyntaxNode {
2154 public:
2155 ExpressionPrimaryNested(
2156 Gyoji::owned<Terminal> _paren_l_token,
2157 Gyoji::owned<Expression> _expression,
2158 Gyoji::owned<Terminal> _paren_r_token
2159 );
2163 ~ExpressionPrimaryNested();
2164 const Expression & get_expression() const;
2165 private:
2166 Gyoji::owned<Terminal> paren_l_token;
2167 Gyoji::owned<Expression> expression;
2168 Gyoji::owned<Terminal> paren_r_token;
2169 };
2170
2171 class ExpressionPrimaryLiteralInt : public Gyoji::frontend::ast::SyntaxNode {
2172 public:
2173 ExpressionPrimaryLiteralInt(
2174 Gyoji::owned<Terminal> literal_token
2175 );
2179 ~ExpressionPrimaryLiteralInt();
2183 const std::string & get_value() const;
2184 const Terminal & get_literal_int_token() const;
2185 const Gyoji::context::SourceReference & get_value_source_ref() const;
2186 private:
2187 Gyoji::owned<Terminal> literal_token;
2188 };
2189 class ExpressionPrimaryLiteralChar : public Gyoji::frontend::ast::SyntaxNode {
2190 public:
2191 ExpressionPrimaryLiteralChar(
2192 Gyoji::owned<Terminal> _literal_token
2193 );
2197 ~ExpressionPrimaryLiteralChar();
2198 std::string get_value() const;
2199 const Gyoji::context::SourceReference & get_value_source_ref() const;
2200 private:
2201 Gyoji::owned<Terminal> literal_token;
2202 };
2203 class ExpressionPrimaryLiteralString : public Gyoji::frontend::ast::SyntaxNode {
2204 public:
2205 ExpressionPrimaryLiteralString(
2206 Gyoji::owned<Terminal> _literal_token
2207 );
2211 ~ExpressionPrimaryLiteralString();
2212 std::string get_value() const;
2213 const Gyoji::context::SourceReference & get_value_source_ref() const;
2214 void add_string(Gyoji::owned<Terminal> _added);
2215 private:
2216 Gyoji::owned<Terminal> literal_token;
2217 std::vector<Gyoji::owned<Terminal>> additional_strings;
2218 };
2219 class ExpressionPrimaryLiteralFloat : public Gyoji::frontend::ast::SyntaxNode {
2220 public:
2221 ExpressionPrimaryLiteralFloat(
2222 Gyoji::owned<Terminal> _literal_token
2223 );
2227 ~ExpressionPrimaryLiteralFloat();
2228
2236 const std::string & get_value() const;
2246 const std::string & get_type() const;
2247 const Gyoji::context::SourceReference & get_value_source_ref() const;
2248 private:
2249 Gyoji::owned<Terminal> literal_token;
2250 std::string float_part;
2251 std::string type_part;
2252 };
2253
2254 class ExpressionPrimaryLiteralBool : public Gyoji::frontend::ast::SyntaxNode {
2255 public:
2256 ExpressionPrimaryLiteralBool(
2257 Gyoji::owned<Terminal> _literal_token
2258 );
2262 ~ExpressionPrimaryLiteralBool();
2263
2268 bool get_value() const;
2269 private:
2270 Gyoji::owned<Terminal> literal_token;
2271 bool value;
2272 };
2273 class ExpressionPrimaryLiteralNull : public Gyoji::frontend::ast::SyntaxNode {
2274 public:
2275 ExpressionPrimaryLiteralNull(
2276 Gyoji::owned<Terminal> _literal_token
2277 );
2281 ~ExpressionPrimaryLiteralNull();
2282 private:
2283 Gyoji::owned<Terminal> literal_token;
2284 };
2285
2286 class ExpressionPostfixArrayIndex : public Gyoji::frontend::ast::SyntaxNode {
2287 public:
2288 ExpressionPostfixArrayIndex(
2289 Gyoji::owned<Expression> _array_expression,
2290 Gyoji::owned<Terminal> _bracket_l_token,
2291 Gyoji::owned<Expression> _index_expression,
2292 Gyoji::owned<Terminal> _bracket_r_token
2293 );
2297 ~ExpressionPostfixArrayIndex();
2298 const Expression & get_array() const;
2299 const Expression & get_index() const;
2300 private:
2301 Gyoji::owned<Expression> array_expression;
2302 Gyoji::owned<Terminal> bracket_l_token;
2303 Gyoji::owned<Expression> index_expression;
2304 Gyoji::owned<Terminal> bracket_r_token;
2305 };
2306
2307 class ArgumentExpressionList : public Gyoji::frontend::ast::SyntaxNode {
2308 public:
2309 ArgumentExpressionList(const Gyoji::context::SourceReference & _source_ref);
2313 ~ArgumentExpressionList();
2314 const std::vector<Gyoji::owned<Expression>> & get_arguments() const;
2315 void add_argument(Gyoji::owned<Expression> _argument);
2316 void add_argument(Gyoji::owned<Terminal> _comma_token, Gyoji::owned<Expression> _argument);
2317 private:
2320 };
2321
2322 class ExpressionPostfixFunctionCall : public Gyoji::frontend::ast::SyntaxNode {
2323 public:
2324 ExpressionPostfixFunctionCall(
2325 Gyoji::owned<Expression> _function_expression,
2326 Gyoji::owned<Terminal> _paren_l_token,
2328 Gyoji::owned<Terminal> _paren_r_token
2329 );
2333 ~ExpressionPostfixFunctionCall();
2334 const Expression & get_function() const;
2335 const ArgumentExpressionList & get_arguments() const;
2336 private:
2337 Gyoji::owned<Expression> function_expression;
2338 Gyoji::owned<Terminal> paren_l_token;
2340 Gyoji::owned<Terminal> paren_r_token;
2341 };
2342
2343 class ExpressionPostfixDot : public Gyoji::frontend::ast::SyntaxNode {
2344 public:
2345 ExpressionPostfixDot(
2346 Gyoji::owned<Expression> _expression,
2347 Gyoji::owned<Terminal> _dot_token,
2348 Gyoji::owned<Terminal> _identifier_token
2349 );
2353 ~ExpressionPostfixDot();
2354 const Expression & get_expression() const;
2355 const Terminal & get_identifier() const;
2356 private:
2357 Gyoji::owned<Expression> expression;
2358 Gyoji::owned<Terminal> dot_token;
2359 Gyoji::owned<Terminal> identifier_token;
2360 };
2361
2362 class ExpressionPostfixArrow : public Gyoji::frontend::ast::SyntaxNode {
2363 public:
2364 ExpressionPostfixArrow(
2365 Gyoji::owned<Expression> _expression,
2366 Gyoji::owned<Terminal> _arrow_token,
2367 Gyoji::owned<Terminal> _identifier_token
2368 );
2372 ~ExpressionPostfixArrow();
2373 const Expression & get_expression() const;
2374 const Terminal & get_identifier() const;
2375 private:
2376 Gyoji::owned<Expression> expression;
2377 Gyoji::owned<Terminal> arrow_token;
2378 Gyoji::owned<Terminal> identifier_token;
2379 };
2380
2381 class ExpressionPostfixIncDec : public Gyoji::frontend::ast::SyntaxNode {
2382 public:
2383 typedef enum {
2384 INCREMENT,
2385 DECREMENT
2386 } OperationType;
2387 ExpressionPostfixIncDec(
2388 Gyoji::owned<Expression> _expression,
2389 Gyoji::owned<Terminal> _operator_token,
2390 ExpressionPostfixIncDec::OperationType _type
2391 );
2395 ~ExpressionPostfixIncDec();
2396 const ExpressionPostfixIncDec::OperationType & get_type() const;
2397 const Expression & get_expression() const;
2398 private:
2399 ExpressionPostfixIncDec::OperationType type;
2400 Gyoji::owned<Terminal> operator_token;
2401 Gyoji::owned<Expression> expression;
2402 };
2403
2404 class ExpressionUnaryPrefix : public Gyoji::frontend::ast::SyntaxNode {
2405 public:
2406 typedef enum {
2407 INCREMENT,
2408 DECREMENT,
2409 ADDRESSOF,
2410 DEREFERENCE,
2411 PLUS,
2412 MINUS,
2413 BITWISE_NOT,
2414 LOGICAL_NOT
2415 } OperationType;
2416 ExpressionUnaryPrefix(
2417 Gyoji::owned<Terminal> _operator_token,
2418 Gyoji::owned<Expression> _expression,
2419 ExpressionUnaryPrefix::OperationType _type
2420 );
2424 ~ExpressionUnaryPrefix();
2425 const ExpressionUnaryPrefix::OperationType & get_type() const;
2426 const Gyoji::context::SourceReference & get_operator_source_ref() const;
2427 const Expression & get_expression() const;
2428 private:
2429 ExpressionUnaryPrefix::OperationType type;
2430 Gyoji::owned<Terminal> operator_token;
2431 Gyoji::owned<Expression> expression;
2432 };
2433
2434 class ExpressionUnarySizeofType : public Gyoji::frontend::ast::SyntaxNode {
2435 public:
2436 ExpressionUnarySizeofType(
2437 Gyoji::owned<Terminal> _sizeof_token,
2438 Gyoji::owned<Terminal> _paren_l_token,
2439 Gyoji::owned<TypeSpecifier> _type_specifier,
2440 Gyoji::owned<Terminal> _paren_r_token
2441 );
2445 ~ExpressionUnarySizeofType();
2446 const TypeSpecifier & get_type_specifier() const;
2447 private:
2448 Gyoji::owned<Terminal> sizeof_token;
2449 Gyoji::owned<Terminal> paren_l_token;
2450 Gyoji::owned<TypeSpecifier> type_specifier;
2451 Gyoji::owned<Terminal> paren_r_token;
2452 };
2453
2454 class ExpressionCast : public Gyoji::frontend::ast::SyntaxNode {
2455 public:
2456 ExpressionCast(
2457 Gyoji::owned<Terminal> _cast_token,
2458 Gyoji::owned<Terminal> _paren_l_token,
2459 Gyoji::owned<TypeSpecifier> _type_specifier,
2460 Gyoji::owned<Terminal> _comma_token,
2461 Gyoji::owned<Expression> _expression,
2462 Gyoji::owned<Terminal> _paren_r_token
2463 );
2467 ~ExpressionCast();
2468 const TypeSpecifier & get_type() const;
2469 const Expression & get_expression() const;
2470 private:
2471 Gyoji::owned<Terminal> cast_token;
2472 Gyoji::owned<Terminal> paren_l_token;
2473 Gyoji::owned<TypeSpecifier> type_specifier;
2474 Gyoji::owned<Terminal> comma_token;
2475 Gyoji::owned<Expression> expression;
2476 Gyoji::owned<Terminal> paren_r_token;
2477 };
2478
2479 class ExpressionBinary : public Gyoji::frontend::ast::SyntaxNode {
2480 public:
2481 typedef enum {
2482 // Arithmetic
2483 ADD,
2484 SUBTRACT,
2485 MULTIPLY,
2486 DIVIDE,
2487 MODULO,
2488 // Logical
2489 LOGICAL_AND,
2490 LOGICAL_OR,
2491
2492 // Bitwise
2493 BITWISE_AND,
2494 BITWISE_OR,
2495 BITWISE_XOR,
2496 SHIFT_LEFT,
2497 SHIFT_RIGHT,
2498
2499 // Relational
2500 COMPARE_LESS,
2501 COMPARE_GREATER,
2502 COMPARE_LESS_EQUAL,
2503 COMPARE_GREATER_EQUAL,
2504 COMPARE_EQUAL,
2505 COMPARE_NOT_EQUAL,
2506
2507 // Assignment
2508 ASSIGNMENT,
2509 MUL_ASSIGNMENT,
2510 DIV_ASSIGNMENT,
2511 MOD_ASSIGNMENT,
2512 ADD_ASSIGNMENT,
2513 SUB_ASSIGNMENT,
2514 LEFT_ASSIGNMENT,
2515 RIGHT_ASSIGNMENT,
2516 AND_ASSIGNMENT,
2517 XOR_ASSIGNMENT,
2518 OR_ASSIGNMENT
2519 } OperationType;
2520 ExpressionBinary(
2521 Gyoji::owned<Expression> _expression_a,
2522 Gyoji::owned<Terminal> _operator_token,
2523 Gyoji::owned<Expression> _expression_b,
2524 ExpressionBinary::OperationType _type
2525 );
2538 ExpressionBinary(
2539 Gyoji::owned<Expression> _expression_a,
2540 Gyoji::owned<Terminal> _operator_token,
2541 Gyoji::owned<Terminal> _operator_token2,
2542 Gyoji::owned<Expression> _expression_b,
2543 ExpressionBinary::OperationType _type
2544 );
2548 ~ExpressionBinary();
2549 const Expression & get_a() const;
2550 const ExpressionBinary::OperationType & get_operator() const;
2551 const Gyoji::context::SourceReference & get_operator_source_ref() const;
2552 const Expression & get_b() const;
2553
2554 private:
2555 OperationType type;
2556 Gyoji::owned<Expression> expression_a;
2557 Gyoji::owned<Terminal> operator_token;
2558 Gyoji::owned<Terminal> operator_token2;
2559 Gyoji::owned<Expression> expression_b;
2560 };
2561
2562 class ExpressionTrinary : public Gyoji::frontend::ast::SyntaxNode {
2563 public:
2564 ExpressionTrinary(
2565 Gyoji::owned<Expression> _condition,
2566 Gyoji::owned<Terminal> _questionmark_token,
2567 Gyoji::owned<Expression> _if_expression,
2568 Gyoji::owned<Terminal> _colon_token,
2569 Gyoji::owned<Expression> _else_expression
2570 );
2574 ~ExpressionTrinary();
2575 const Expression & get_condition() const;
2576 const Expression & get_if() const;
2577 const Expression & get_else() const;
2578 private:
2579 Gyoji::owned<Expression> condition;
2580 Gyoji::owned<Terminal> questionmark_token;
2581 Gyoji::owned<Expression> if_expression;
2582 Gyoji::owned<Terminal> colon_token;
2583 Gyoji::owned<Expression> else_expression;
2584 };
2585
2586 class Expression : public Gyoji::frontend::ast::SyntaxNode {
2587 public:
2588 typedef std::variant<
2607 > ExpressionType;
2608 Expression(Expression::ExpressionType _expression_type, const SyntaxNode & _sn);
2612 ~Expression();
2613 const Expression::ExpressionType & get_expression() const;
2614 private:
2615 Expression::ExpressionType expression_type;
2616 };
2617
2618 class GlobalInitializerExpressionPrimary : public Gyoji::frontend::ast::SyntaxNode {
2619 public:
2620 GlobalInitializerExpressionPrimary(
2621 Gyoji::owned<Terminal> _equals_token,
2622 Gyoji::owned<Expression> _expression
2623 );
2627 ~GlobalInitializerExpressionPrimary();
2628 const Expression & get_expression() const;
2629 private:
2630 Gyoji::owned<Terminal> equals_token;
2631 Gyoji::owned<Expression> expression;
2632
2633 };
2634 class GlobalInitializerAddressofExpressionPrimary : public Gyoji::frontend::ast::SyntaxNode {
2635 public:
2636 GlobalInitializerAddressofExpressionPrimary(
2637 Gyoji::owned<Terminal> _equals_token,
2638 Gyoji::owned<Terminal> _addressof_token,
2639 Gyoji::owned<Expression> _expression
2640 );
2644 ~GlobalInitializerAddressofExpressionPrimary();
2645 const Expression & get_expression() const;
2646 private:
2647 Gyoji::owned<Terminal> equals_token;
2648 Gyoji::owned<Terminal> addressof_token;
2649 Gyoji::owned<Expression> expression;
2650 };
2651
2652 class StructInitializer : public Gyoji::frontend::ast::SyntaxNode {
2653 public:
2654 StructInitializer(
2655 Gyoji::owned<Terminal> _dot_token,
2656 Gyoji::owned<Terminal> _identifier_token,
2657 Gyoji::owned<GlobalInitializer> _global_initializer,
2658 Gyoji::owned<Terminal> _semicolon_token
2659 );
2663 ~StructInitializer();
2664 const GlobalInitializer & get_initializer() const;
2665 private:
2666 Gyoji::owned<Terminal> dot_token;
2667 Gyoji::owned<Terminal> identifier_token;
2668 Gyoji::owned<GlobalInitializer> global_initializer;
2669 Gyoji::owned<Terminal> semicolon_token;
2670 };
2671
2672 class StructInitializerList : public Gyoji::frontend::ast::SyntaxNode {
2673 public:
2674 StructInitializerList(const Gyoji::context::SourceReference & _source_ref);
2678 ~StructInitializerList();
2679 void add_initializer(Gyoji::owned<StructInitializer> initializer);
2680 const std::vector<Gyoji::owned<StructInitializer>> & get_initializers() const;
2681 private:
2683 };
2684
2685 class GlobalInitializerStructInitializerList : public Gyoji::frontend::ast::SyntaxNode {
2686 public:
2687 GlobalInitializerStructInitializerList(
2688 Gyoji::owned<Terminal> _equals_token,
2689 Gyoji::owned<Terminal> _brace_l_token,
2690 Gyoji::owned<StructInitializerList> _struct_initializer,
2691 Gyoji::owned<Terminal> _brace_r_token
2692 );
2693
2697 ~GlobalInitializerStructInitializerList();
2698 const StructInitializerList & get_struct_initializer() const;
2699 private:
2700 Gyoji::owned<Terminal> equals_token;
2701 Gyoji::owned<Terminal> brace_l_token;
2702 Gyoji::owned<StructInitializerList> struct_initializer;
2703 Gyoji::owned<Terminal> brace_r_token;
2704 };
2705
2706 class GlobalInitializer : public Gyoji::frontend::ast::SyntaxNode {
2707 public:
2708 typedef std::variant<
2712 nullptr_t> GlobalInitializerType;
2713 GlobalInitializer(const Gyoji::context::SourceReference & _source_ref);
2714 GlobalInitializer(GlobalInitializerType initializer, const Gyoji::frontend::ast::SyntaxNode & _sn);
2718 ~GlobalInitializer();
2719 const GlobalInitializerType & get_initializer() const;
2720 private:
2721 GlobalInitializerType initializer;
2722 };
2723
2724 class FileStatementGlobalDefinition : public Gyoji::frontend::ast::SyntaxNode {
2725 public:
2726 FileStatementGlobalDefinition(
2727 Gyoji::owned<AccessModifier> _access_modifier,
2728 Gyoji::owned<UnsafeModifier> _unsafe_modifier,
2729 Gyoji::owned<TypeSpecifier> _type_specifier,
2731 Gyoji::owned<GlobalInitializer> _global_initializer,
2732 Gyoji::owned<Terminal> _semicolon
2733 );
2737 ~FileStatementGlobalDefinition();
2738 const AccessModifier & get_access_modifier() const;
2739 const UnsafeModifier & get_unsafe_modifier() const;
2740 const TypeSpecifier & get_type_specifier() const;
2741 const std::string & get_name() const;
2742 const Gyoji::context::SourceReference & get_name_source_ref() const;
2743 const GlobalInitializer & get_global_initializer() const;
2744 private:
2745 Gyoji::owned<AccessModifier> access_modifier;
2746 Gyoji::owned<UnsafeModifier> unsafe_modifier;
2747 Gyoji::owned<TypeSpecifier> type_specifier;
2748 Gyoji::owned<Terminal> name; // function name (IDENTIFIER)
2749 Gyoji::owned<GlobalInitializer> global_initializer;
2750 Gyoji::owned<Terminal> semicolon;
2751 };
2752
2753 class NamespaceDeclaration : public Gyoji::frontend::ast::SyntaxNode {
2754 public:
2755 NamespaceDeclaration(
2756 Gyoji::owned<AccessModifier> _access_modifier,
2757 Gyoji::owned<Terminal> _namespace_token,
2758 Gyoji::owned<Terminal> _identifier_token
2759 );
2763 ~NamespaceDeclaration();
2764 const AccessModifier & get_access_modifier() const;
2765 const Terminal & get_name() const;
2766 private:
2767 Gyoji::owned<AccessModifier> access_modifier;
2768 Gyoji::owned<Terminal> namespace_token;
2769 Gyoji::owned<Terminal> identifier_token;
2770 };
2771
2772 class FileStatementNamespace : public Gyoji::frontend::ast::SyntaxNode {
2773 public:
2774 FileStatementNamespace(
2775 Gyoji::owned<NamespaceDeclaration> _namespace_declaration,
2776 Gyoji::owned<Terminal> _brace_l_token,
2777 Gyoji::owned<FileStatementList> _file_statement_list,
2778 Gyoji::owned<Terminal> _brace_r_token,
2779 Gyoji::owned<Terminal> _semicolon_token
2780 );
2784 ~FileStatementNamespace();
2785 const NamespaceDeclaration & get_declaration() const;
2786 const FileStatementList & get_statement_list() const;
2787 private:
2788 Gyoji::owned<NamespaceDeclaration> namespace_declaration;
2789 Gyoji::owned<Terminal> brace_l_token;
2790 Gyoji::owned<FileStatementList> file_statement_list;
2791 Gyoji::owned<Terminal> brace_r_token;
2792 Gyoji::owned<Terminal> semicolon_token;
2793 };
2794
2795 class UsingAs : public Gyoji::frontend::ast::SyntaxNode {
2796 public:
2797 UsingAs(
2798 Gyoji::owned<Terminal> _as_token,
2799 Gyoji::owned<Terminal> _identifier_token
2800 );
2801 UsingAs(const Gyoji::context::SourceReference & _source_ref);
2805 ~UsingAs();
2806 bool is_as() const;
2807 const std::string & get_using_name() const;
2808 const Gyoji::context::SourceReference & get_using_name_source_ref() const;
2809 private:
2810 bool aas;
2811 std::string using_name;
2812 Gyoji::owned<Terminal> as_token;
2813 Gyoji::owned<Terminal> identifier_token;
2814 };
2815
2816 class FileStatementUsing : public Gyoji::frontend::ast::SyntaxNode {
2817 public:
2818 FileStatementUsing(
2819 Gyoji::owned<AccessModifier> _access_modifier,
2821 Gyoji::owned<Terminal> _namespace,
2822 Gyoji::owned<Terminal> _namespace_name,
2823 Gyoji::owned<UsingAs> _using_as,
2824 Gyoji::owned<Terminal> _semicolon);
2828 ~FileStatementUsing();
2829 private:
2830 const AccessModifier & get_access_modifier() const;
2831 std::string get_namespace() const;
2832 const Gyoji::context::SourceReference & get_namespace_source_ref() const;
2833 const UsingAs &get_using_as() const;
2834
2835 Gyoji::owned<AccessModifier> access_modifier;
2836 Gyoji::owned<Terminal> using_token;
2837 Gyoji::owned<Terminal> namespace_token;
2838 Gyoji::owned<Terminal> namespace_name_token;
2839 Gyoji::owned<UsingAs> using_as;
2840 Gyoji::owned<Terminal> semicolon_token;
2841 };
2842
2851 public:
2858 const std::vector<Gyoji::owned<FileStatement>> & get_statements() const;
2859 void add_statement(Gyoji::owned<FileStatement> statement);
2860 private:
2863 };
2864
2866
2890 public:
2892 Gyoji::owned<FileStatementList> file_statement_list,
2893 Gyoji::owned<Terminal> yyeof_token
2894 );
2904 private:
2905 Gyoji::owned<FileStatementList> file_statement_list;
2906 Gyoji::owned<Terminal> yyeof_token;
2907
2908 };
2909
2910};
2911
size_t start() const
References a location in the source-file.
Definition source-reference.hpp:30
Represents a token read from the input stream.
Definition token-stream.hpp:55
Weakly-typed syntax node.
Definition syntax-node.hpp:69
SyntaxNode(Gyoji::context::TokenID _type, specific_type_t _data, const Gyoji::context::SourceReference &_source_ref)
Definition syntax-node.cpp:22
Entity living inside a namespace.
Definition ns2.hpp:40
Declares PUBLIC, PROTECTED, or PRIVATE access to functions and members.
Definition tree.hpp:321
~AccessModifier()
Definition tree.cpp:157
const AccessModifierType & get_type() const
Definition tree.cpp:160
AccessModifierType
Definition tree.hpp:323
@ PRIVATE
Definition tree.hpp:337
@ PROTECTED
Definition tree.hpp:332
@ PUBLIC
Definition tree.hpp:327
This indicates the type of access that may be permitted as UNSPECIFIED, CONST, or VOLATILE.
Definition tree.hpp:262
~AccessQualifier()
Definition tree.cpp:125
AccessQualifierType
Definition tree.hpp:264
@ CONST
Definition tree.hpp:288
@ VOLATILE
Definition tree.hpp:281
@ UNSPECIFIED
Definition tree.hpp:272
const AccessQualifier::AccessQualifierType & get_type() const
Definition tree.cpp:128
~ClassDeclaration()
Definition tree.cpp:1677
Represents the declaration of a function.
Definition tree.hpp:982
const AccessModifier & get_access_modifier() const
Definition tree.cpp:581
const FunctionDefinitionArgList & get_arguments() const
Definition tree.cpp:599
const Terminal & get_name() const
Definition tree.cpp:596
const TypeSpecifier & get_return_type() const
Definition tree.cpp:592
const UnsafeModifier & get_unsafe_modifier() const
Definition tree.cpp:584
~FileStatementList()
Definition tree.cpp:2730
const FileStatementType & get_statement() const
Definition tree.cpp:2714
Represents the list of arguments to a function definition.
Definition tree.hpp:913
void add_argument(Gyoji::owned< FunctionDefinitionArg > _argument)
Definition tree.cpp:484
void add_comma(Gyoji::owned< Terminal > _comma)
Definition tree.cpp:490
~FunctionDefinitionArgList()
Definition tree.cpp:478
const std::vector< Gyoji::owned< FunctionDefinitionArg > > & get_arguments() const
Definition tree.cpp:481
Represents an argument in a function definition.
Definition tree.hpp:886
~FunctionDefinitionArg()
Definition tree.cpp:442
const TypeSpecifier & get_type_specifier() const
Definition tree.cpp:445
const Terminal & get_identifier() const
Definition tree.cpp:448
Represents a block of statements in a particular scope.
Definition tree.hpp:1177
const ScopeBody & get_scope_body() const
Definition tree.cpp:778
const UnsafeModifier & get_unsafe_modifier() const
Definition tree.cpp:775
~StatementBlock()
Definition tree.cpp:772
This represents a statement in a function or scope that computes an expression.
Definition tree.hpp:1221
~StatementExpression()
Definition tree.cpp:792
This represents an if condition in one of several forms.
Definition tree.hpp:1292
const ScopeBody & get_if_scope_body() const
Definition tree.cpp:891
const Expression & get_expression() const
Definition tree.cpp:888
~StatementIfElse()
Definition tree.cpp:879
const StatementIfElse & get_else_if() const
Definition tree.cpp:897
const ScopeBody & get_else_scope_body() const
Definition tree.cpp:894
Represents the declaration of a variable inside the scope of a function or block.
Definition tree.hpp:1115
const Terminal & get_identifier() const
Definition tree.cpp:755
const InitializerExpression & get_initializer_expression() const
Definition tree.cpp:758
const TypeSpecifier & get_type_specifier() const
Definition tree.cpp:752
Represents a 'while' statement in a function or scope.
Definition tree.hpp:1395
const Expression & get_expression() const
Definition tree.cpp:923
~StatementWhile()
Definition tree.cpp:920
Represents whitespace, comments, and metadata for the source file.
Definition tree.hpp:44
~TerminalNonSyntax()
Definition tree.cpp:89
@ EXTRA_FILE_METADATA
Definition tree.hpp:68
@ EXTRA_WHITESPACE
Definition tree.hpp:61
@ EXTRA_COMMENT_MULTI_LINE
Definition tree.hpp:56
@ EXTRA_COMMENT_SINGLE_LINE
Definition tree.hpp:51
const std::string & get_data() const
Definition tree.cpp:97
const Type & get_type() const
Definition tree.cpp:92
Represents tokens from the lexer used to represent keywords and identifiers found in the source.
Definition tree.hpp:103
std::string get_fully_qualified_name() const
Definition tree.cpp:46
std::string get_name() const
Definition tree.cpp:54
const std::string & get_value() const
Definition tree.cpp:39
const Gyoji::context::TokenID & get_type() const
Definition tree.cpp:36
IdentifierType
Definition tree.hpp:118
@ IDENTIFIER_GLOBAL_SCOPE
Definition tree.hpp:125
@ IDENTIFIER_UNCATEGORIZED
Definition tree.hpp:139
@ IDENTIFIER_LOCAL_SCOPE
Definition tree.hpp:131
const Gyoji::context::SourceReference & get_terminal_source_ref() const
Definition tree.cpp:42
~Terminal()
Definition tree.cpp:33
Represents the top-level syntax unit for a source file.
Definition tree.hpp:2889
const std::vector< Gyoji::owned< FileStatement > > & get_statements() const
Definition tree.cpp:2756
~TranslationUnit()
Definition tree.cpp:2752
Represents the name of a type.
Definition tree.hpp:431
~TypeName()
Definition tree.cpp:217
bool is_expression() const
Definition tree.cpp:220
std::string get_name() const
Definition tree.cpp:223
const Expression & get_expression() const
Definition tree.cpp:229
Represents arguments to a template type.
Definition tree.hpp:507
~TypeSpecifierCallArgs()
Definition tree.cpp:237
const std::vector< Gyoji::owned< TypeSpecifier > > & get_arguments() const
Definition tree.cpp:254
void add_argument(Gyoji::owned< TypeSpecifier > _argument)
Definition tree.cpp:240
Represents a pointer to a function.
Definition tree.hpp:631
const TypeSpecifierList & get_args() const
Definition tree.cpp:335
const TypeSpecifier & get_return_type() const
Definition tree.cpp:332
Represents the list of arguments to a function pointer (comma-separated list of types)
Definition tree.hpp:945
~TypeSpecifierList()
Definition tree.cpp:455
void add_argument(Gyoji::owned< TypeSpecifier > _argument)
Definition tree.cpp:461
void add_comma(Gyoji::owned< Terminal > _comma)
Definition tree.cpp:467
const std::vector< Gyoji::owned< TypeSpecifier > > & get_arguments() const
Definition tree.cpp:458
Represents an unsafe poniter to a specific type.
Definition tree.hpp:701
~TypeSpecifierPointerTo()
Definition tree.cpp:352
const AccessQualifier & get_access_qualifier() const
Definition tree.cpp:358
const TypeSpecifier & get_type_specifier() const
Definition tree.cpp:355
Represents a safe reference to a specific type.
Definition tree.hpp:792
const AccessQualifier & get_access_qualifier() const
Definition tree.cpp:381
~TypeSpecifierReferenceTo()
Definition tree.cpp:375
const TypeSpecifier & get_type_specifier() const
Definition tree.cpp:378
Represents a simple type.
Definition tree.hpp:545
const AccessQualifier & get_access_qualifier() const
Definition tree.cpp:272
const TypeName & get_type_name() const
Definition tree.cpp:275
~TypeSpecifierSimple()
Definition tree.cpp:269
Represents a type with type-arguments modifying the type's definition.
Definition tree.hpp:595
~TypeSpecifierTemplate()
Definition tree.cpp:295
const TypeSpecifierCallArgs & get_args() const
Definition tree.cpp:301
const TypeSpecifier & get_type() const
Definition tree.cpp:298
Represents a type being specified.
Definition tree.hpp:855
~TypeSpecifier()
Definition tree.cpp:424
const TypeSpecifier::TypeSpecifierType & get_type() const
Definition tree.cpp:427
Represents the safety/borrow check semantics for a function or block.
Definition tree.hpp:376
~UnsafeModifier()
Definition tree.cpp:177
bool is_unsafe() const
Definition tree.cpp:180
Strongly-typed syntax tree.
Definition forward.hpp:44