aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.HLE.Generators/ServiceSyntaxReceiver.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Ryujinx.HLE.Generators/ServiceSyntaxReceiver.cs')
-rw-r--r--src/Ryujinx.HLE.Generators/ServiceSyntaxReceiver.cs24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/Ryujinx.HLE.Generators/ServiceSyntaxReceiver.cs b/src/Ryujinx.HLE.Generators/ServiceSyntaxReceiver.cs
new file mode 100644
index 00000000..e4269cb9
--- /dev/null
+++ b/src/Ryujinx.HLE.Generators/ServiceSyntaxReceiver.cs
@@ -0,0 +1,24 @@
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using System.Collections.Generic;
+
+namespace Ryujinx.HLE.Generators
+{
+ internal class ServiceSyntaxReceiver : ISyntaxReceiver
+ {
+ public HashSet<ClassDeclarationSyntax> Types = new HashSet<ClassDeclarationSyntax>();
+
+ public void OnVisitSyntaxNode(SyntaxNode syntaxNode)
+ {
+ if (syntaxNode is ClassDeclarationSyntax classDeclaration)
+ {
+ if (classDeclaration.BaseList == null)
+ {
+ return;
+ }
+
+ Types.Add(classDeclaration);
+ }
+ }
+ }
+}