ServiceSyntaxReceiver.cs 657 B

123456789101112131415161718192021222324
  1. using Microsoft.CodeAnalysis;
  2. using Microsoft.CodeAnalysis.CSharp.Syntax;
  3. using System.Collections.Generic;
  4. namespace Ryujinx.HLE.Generators
  5. {
  6. internal class ServiceSyntaxReceiver : ISyntaxReceiver
  7. {
  8. public HashSet<ClassDeclarationSyntax> Types = new HashSet<ClassDeclarationSyntax>();
  9. public void OnVisitSyntaxNode(SyntaxNode syntaxNode)
  10. {
  11. if (syntaxNode is ClassDeclarationSyntax classDeclaration)
  12. {
  13. if (classDeclaration.BaseList == null)
  14. {
  15. return;
  16. }
  17. Types.Add(classDeclaration);
  18. }
  19. }
  20. }
  21. }