This commit is contained in:
nub31
2025-07-04 17:48:56 +02:00
parent 9a21ec5d8d
commit cea72bf846
11 changed files with 346 additions and 78 deletions

View File

@@ -50,6 +50,34 @@ public class DefinitionTable
.SelectMany(c => c.Definitions)
.OfType<FuncDefinition>();
}
public IEnumerable<LocalFuncDefinitionNode> GetLocalFunctions()
{
return _syntaxTrees
.SelectMany(c => c.Definitions)
.OfType<LocalFuncDefinitionNode>();
}
public IEnumerable<ExternFuncDefinitionNode> GetExternFunctions()
{
return _syntaxTrees
.SelectMany(c => c.Definitions)
.OfType<ExternFuncDefinitionNode>();
}
public IEnumerable<InterfaceDefinitionNode> GetInterfaces()
{
return _syntaxTrees
.SelectMany(c => c.Definitions)
.OfType<InterfaceDefinitionNode>();
}
public IEnumerable<ImplementationDefinitionNode> GetImplementations()
{
return _syntaxTrees
.SelectMany(c => c.Definitions)
.OfType<ImplementationDefinitionNode>();
}
}
public class BoundDefinitionTable
@@ -96,4 +124,32 @@ public class BoundDefinitionTable
.SelectMany(c => c.Definitions)
.OfType<BoundFuncDefinition>();
}
public IEnumerable<BoundLocalFuncDefinitionNode> GetLocalFunctions()
{
return _syntaxTrees
.SelectMany(c => c.Definitions)
.OfType<BoundLocalFuncDefinitionNode>();
}
public IEnumerable<BoundExternFuncDefinitionNode> GetExternFunctions()
{
return _syntaxTrees
.SelectMany(c => c.Definitions)
.OfType<BoundExternFuncDefinitionNode>();
}
public IEnumerable<BoundInterfaceDefinitionNode> GetInterfaces()
{
return _syntaxTrees
.SelectMany(c => c.Definitions)
.OfType<BoundInterfaceDefinitionNode>();
}
public IEnumerable<BoundImplementationDefinitionNode> GetImplementations()
{
return _syntaxTrees
.SelectMany(c => c.Definitions)
.OfType<BoundImplementationDefinitionNode>();
}
}