LILAC
Language to language Interop LAyer Compiler
Loading...
Searching...
No Matches
interfacevisitor.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2024 Yeong-won Seo
3 *
4 * This file is part of LILAC.
5 *
6 * LILAC is free software: you can redistribute it and/or modify it under
7 * the terms of the GNU General Public License as published by the Free
8 * Software Foundation, either version 3, or (at your option) any later
9 * version.
10 *
11 * LILAC is distributed in the hope that it will be useful, but WITHOUT ANY
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20#pragma once
22
24{
26 {
27 std::string RootNamespace;
28 std::string LibraryName;
29 std::ostream& Output;
30 };
31
36 {
37 public:
38 void Begin(VisitContext& ctx, const frxml::dom& parent, const frxml::dom& current, int depth) override;
39
40 void End(VisitContext& ctx, const frxml::dom& parent, const frxml::dom& current, int depth) override;
41 };
42
46 class NamespaceVisitor final : public shared::InterfaceVisitor<VisitContext>
47 {
48 public:
49 [[nodiscard]]
50 std::string GetName() const override;
51
52 void Begin(VisitContext& ctx, const frxml::dom& parent, const frxml::dom& current, int depth) override;
53
54 void End(VisitContext& ctx, const frxml::dom& parent, const frxml::dom& current, int depth) override;
55 };
56
60 class RecordVisitor final : public shared::InterfaceVisitor<VisitContext>
61 {
62 public:
63 [[nodiscard]]
64 std::string GetName() const override;
65
66 void Begin(VisitContext& ctx, const frxml::dom& parent, const frxml::dom& current, int depth) override;
67
68 void End(VisitContext& ctx, const frxml::dom& parent, const frxml::dom& current, int depth) override;
69 };
70
74 class EnumVisitor final : public shared::InterfaceVisitor<VisitContext>
75 {
76 public:
77 [[nodiscard]]
78 std::string GetName() const override;
79
80 void Begin(VisitContext& ctx, const frxml::dom& parent, const frxml::dom& current, int depth) override;
81
82 void End(VisitContext& ctx, const frxml::dom& parent, const frxml::dom& current, int depth) override;
83 };
84
88 class EnumConstantVisitor final : public shared::InterfaceVisitor<VisitContext>
89 {
90 public:
91 [[nodiscard]]
92 std::string GetName() const override;
93
94 void Begin(VisitContext& ctx, const frxml::dom& parent, const frxml::dom& current, int depth) override;
95
96 void End(VisitContext& ctx, const frxml::dom& parent, const frxml::dom& current, int depth) override;
97 };
98
102 class FunctionVisitor : public shared::InterfaceVisitor<VisitContext>
103 {
104 public:
105 [[nodiscard]]
106 std::string GetName() const override;
107
108 void Begin(VisitContext& ctx, const frxml::dom& parent, const frxml::dom& current, int depth) final;
109
110 void End(VisitContext& ctx, const frxml::dom& parent, const frxml::dom& current, int depth) final;
111 };
112
117 {
118 public:
119 [[nodiscard]]
120 std::string GetName() const override;
121 };
122
126 class CtorVisitor final : public MethodVisitor
127 {
128 public:
129 [[nodiscard]]
130 std::string GetName() const override;
131 };
132
136 class DtorVisitor final : public MethodVisitor
137 {
138 public:
139 [[nodiscard]]
140 std::string GetName() const override;
141 };
142}
A visitor that creates bridge of assembly elements with C#.
void Begin(VisitContext &ctx, const frxml::dom &parent, const frxml::dom &current, int depth) override
void End(VisitContext &ctx, const frxml::dom &parent, const frxml::dom &current, int depth) override
A visitor that creates bridge of ctor elements with C#.
std::string GetName() const override
Gets the name of this interface visitor.
A visitor that creates bridge of dtor elements with C#.
std::string GetName() const override
Gets the name of this interface visitor.
A visitor that creates bridge of constant elements with C#.
std::string GetName() const override
Gets the name of this interface visitor.
void End(VisitContext &ctx, const frxml::dom &parent, const frxml::dom &current, int depth) override
void Begin(VisitContext &ctx, const frxml::dom &parent, const frxml::dom &current, int depth) override
A visitor that creates bridge of enum elements with C#.
void End(VisitContext &ctx, const frxml::dom &parent, const frxml::dom &current, int depth) override
void Begin(VisitContext &ctx, const frxml::dom &parent, const frxml::dom &current, int depth) override
std::string GetName() const override
Gets the name of this interface visitor.
A visitor that creates bridge of function elements with C#.
void Begin(VisitContext &ctx, const frxml::dom &parent, const frxml::dom &current, int depth) final
void End(VisitContext &ctx, const frxml::dom &parent, const frxml::dom &current, int depth) final
std::string GetName() const override
Gets the name of this interface visitor.
A visitor that creates bridge of method elements with C#.
std::string GetName() const override
Gets the name of this interface visitor.
A visitor that creates bridge of namespace elements with C#.
void End(VisitContext &ctx, const frxml::dom &parent, const frxml::dom &current, int depth) override
void Begin(VisitContext &ctx, const frxml::dom &parent, const frxml::dom &current, int depth) override
std::string GetName() const override
Gets the name of this interface visitor.
A visitor that creates bridge of record elements with C#.
void End(VisitContext &ctx, const frxml::dom &parent, const frxml::dom &current, int depth) override
void Begin(VisitContext &ctx, const frxml::dom &parent, const frxml::dom &current, int depth) override
std::string GetName() const override
Gets the name of this interface visitor.
An interface visitor for a whole assembly.
A helper class to traverse interface graph.