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."
156 const Gyoji::context::TokenID &
get_type()
const;
219 typedef std::variant<
250 FileStatementType statement;
488 bool m_is_expression;
747 ~TypeSpecifierArray();
758 const Terminal & get_literal_int_token()
const;
857 typedef std::variant<
873 const TypeSpecifier::TypeSpecifierType &
get_type()
const;
875 TypeSpecifier::TypeSpecifierType type;
1005 bool is_destructor()
const;
1032 InitializerExpression(
1035 InitializerExpression(
1039 InitializerExpression(
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;
1056 StructInitializerExpression(
1061 ~StructInitializerExpression();
1062 const StructInitializerFieldList & get_field_list()
const;
1073 ~StructInitializerFieldList();
1082 StructInitializerFieldExpression(
1089 ~StructInitializerFieldExpression();
1090 const Terminal & get_identifier()
const;
1091 const Expression & get_expression()
const;
1231 const Expression & get_expression()
const;
1364 bool has_else()
const;
1365 bool has_else_if()
const;
1415 const ScopeBody & get_scope_body()
const;
1455 bool is_declaration()
const;
1465 const Terminal & get_identifier()
const;
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;
1472 bool is_declaration_initializer;
1489 StatementSwitchBlock(
1494 StatementSwitchBlock(
1503 ~StatementSwitchBlock();
1504 bool is_default()
const;
1505 const Expression & get_expression();
1506 const ScopeBody & get_scope_body();
1525 ~StatementSwitchContent();
1547 const Expression & get_expression()
const;
1548 const StatementSwitchContent & get_switch_content()
const;
1617 ~StatementContinue();
1643 bool is_void()
const;
1644 const Expression & get_expression()
const;
1654 typedef std::variant<
1669 Statement(StatementType _statement,
const SyntaxNode & _sn);
1674 const StatementType & get_statement()
const;
1676 StatementType statement;
1703 const StatementList & get_statements()
const;
1713 FileStatementFunctionDeclStart(
1719 FileStatementFunctionDeclStart(
1724 ~FileStatementFunctionDeclStart();
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;
1734 bool m_is_destructor;
1741 FileStatementFunctionDefinition(
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;
1762 const ScopeBody & get_scope_body()
const;
1784 bool is_array()
const;
1785 size_t get_size()
const;
1806 const AccessModifier & get_access_modifier()
const;
1807 const Terminal & get_identifier()
const;
1810 const ClassArgumentList & get_argument_list()
const;
1824 ~ClassArgumentList();
1837 ClassMemberDeclarationVariable(
1847 ~ClassMemberDeclarationVariable();
1848 const AccessModifier & get_access_modifier()
const;
1849 const UnsafeModifier & get_unsafe_modifier()
const;
1850 const TypeSpecifier & get_type_specifier()
const;
1862 ClassMemberDeclarationMethod(
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;
1893 ClassMemberDeclarationMethodStatic(
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;
1926 ClassMemberDeclarationDestructor(
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;
1957 typedef std::variant<
1967 ClassMemberDeclaration(
1974 ~ClassMemberDeclaration();
1975 const ClassMemberDeclaration::MemberType & get_member();
1986 ~ClassMemberDeclarationList();
2013 const ClassArgumentList & get_argument_list()
const;
2036 const ClassArgumentList & get_argument_list()
const;
2059 const AccessModifier & get_access_modifier()
const;
2062 const TypeSpecifier & get_type_specifier()
const;
2073 EnumDefinitionValue(
2082 ~EnumDefinitionValue();
2085 const Expression & get_expression()
const;
2099 ~EnumDefinitionValueList();
2122 const AccessModifier & get_access_modifier()
const;
2129 const EnumDefinitionValueList & get_value_list()
const;
2148 ~ExpressionPrimaryIdentifier();
2149 const Terminal & get_identifier()
const;
2155 ExpressionPrimaryNested(
2163 ~ExpressionPrimaryNested();
2164 const Expression & get_expression()
const;
2173 ExpressionPrimaryLiteralInt(
2179 ~ExpressionPrimaryLiteralInt();
2184 const Terminal & get_literal_int_token()
const;
2191 ExpressionPrimaryLiteralChar(
2197 ~ExpressionPrimaryLiteralChar();
2205 ExpressionPrimaryLiteralString(
2211 ~ExpressionPrimaryLiteralString();
2221 ExpressionPrimaryLiteralFloat(
2227 ~ExpressionPrimaryLiteralFloat();
2256 ExpressionPrimaryLiteralBool(
2262 ~ExpressionPrimaryLiteralBool();
2268 bool get_value()
const;
2275 ExpressionPrimaryLiteralNull(
2281 ~ExpressionPrimaryLiteralNull();
2288 ExpressionPostfixArrayIndex(
2297 ~ExpressionPostfixArrayIndex();
2298 const Expression & get_array()
const;
2299 const Expression & get_index()
const;
2313 ~ArgumentExpressionList();
2324 ExpressionPostfixFunctionCall(
2333 ~ExpressionPostfixFunctionCall();
2334 const Expression & get_function()
const;
2335 const ArgumentExpressionList & get_arguments()
const;
2345 ExpressionPostfixDot(
2353 ~ExpressionPostfixDot();
2354 const Expression & get_expression()
const;
2355 const Terminal & get_identifier()
const;
2364 ExpressionPostfixArrow(
2372 ~ExpressionPostfixArrow();
2373 const Expression & get_expression()
const;
2374 const Terminal & get_identifier()
const;
2387 ExpressionPostfixIncDec(
2390 ExpressionPostfixIncDec::OperationType _type
2395 ~ExpressionPostfixIncDec();
2396 const ExpressionPostfixIncDec::OperationType & get_type()
const;
2397 const Expression & get_expression()
const;
2399 ExpressionPostfixIncDec::OperationType type;
2416 ExpressionUnaryPrefix(
2419 ExpressionUnaryPrefix::OperationType _type
2424 ~ExpressionUnaryPrefix();
2425 const ExpressionUnaryPrefix::OperationType & get_type()
const;
2427 const Expression & get_expression()
const;
2429 ExpressionUnaryPrefix::OperationType type;
2436 ExpressionUnarySizeofType(
2445 ~ExpressionUnarySizeofType();
2446 const TypeSpecifier & get_type_specifier()
const;
2468 const TypeSpecifier & get_type()
const;
2469 const Expression & get_expression()
const;
2503 COMPARE_GREATER_EQUAL,
2524 ExpressionBinary::OperationType _type
2543 ExpressionBinary::OperationType _type
2548 ~ExpressionBinary();
2549 const Expression & get_a()
const;
2550 const ExpressionBinary::OperationType & get_operator()
const;
2552 const Expression & get_b()
const;
2574 ~ExpressionTrinary();
2575 const Expression & get_condition()
const;
2576 const Expression & get_if()
const;
2577 const Expression & get_else()
const;
2588 typedef std::variant<
2608 Expression(Expression::ExpressionType _expression_type,
const SyntaxNode & _sn);
2613 const Expression::ExpressionType & get_expression()
const;
2615 Expression::ExpressionType expression_type;
2620 GlobalInitializerExpressionPrimary(
2627 ~GlobalInitializerExpressionPrimary();
2628 const Expression & get_expression()
const;
2636 GlobalInitializerAddressofExpressionPrimary(
2644 ~GlobalInitializerAddressofExpressionPrimary();
2645 const Expression & get_expression()
const;
2663 ~StructInitializer();
2664 const GlobalInitializer & get_initializer()
const;
2678 ~StructInitializerList();
2687 GlobalInitializerStructInitializerList(
2697 ~GlobalInitializerStructInitializerList();
2698 const StructInitializerList & get_struct_initializer()
const;
2708 typedef std::variant<
2712 nullptr_t> GlobalInitializerType;
2718 ~GlobalInitializer();
2719 const GlobalInitializerType & get_initializer()
const;
2721 GlobalInitializerType initializer;
2726 FileStatementGlobalDefinition(
2737 ~FileStatementGlobalDefinition();
2738 const AccessModifier & get_access_modifier()
const;
2739 const UnsafeModifier & get_unsafe_modifier()
const;
2740 const TypeSpecifier & get_type_specifier()
const;
2743 const GlobalInitializer & get_global_initializer()
const;
2755 NamespaceDeclaration(
2763 ~NamespaceDeclaration();
2764 const AccessModifier & get_access_modifier()
const;
2765 const Terminal & get_name()
const;
2774 FileStatementNamespace(
2784 ~FileStatementNamespace();
2785 const NamespaceDeclaration & get_declaration()
const;
2786 const FileStatementList & get_statement_list()
const;
2828 ~FileStatementUsing();
2830 const AccessModifier & get_access_modifier()
const;
2833 const UsingAs &get_using_as()
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
~FileStatementFunctionDeclaration()
Definition tree.cpp:578
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
~StatementVariableDeclaration()
Definition tree.cpp:749
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
Type
Definition tree.hpp:46
@ 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
~TypeSpecifierFunctionPointer()
Definition tree.cpp:330
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