LILAC
Language to language Interop LAyer Compiler
Loading...
Searching...
No Matches
IExporter.cs
Go to the documentation of this file.
1
using
System.CodeDom.Compiler;
2
using
System.Runtime.InteropServices.JavaScript;
3
using
System.Xml.Linq;
4
using
Microsoft.CodeAnalysis;
5
6
namespace
Lilac.Generator.Exporters
;
7
8
public
interface
IExporter
9
{
10
public
void
GenerateUnmanagedCode
(IndentedTextWriter source, IndentedTextWriter header);
11
public
void
GenerateManagedCode
(IndentedTextWriter builder);
12
13
public
static
IExporter
Create
(ISymbol symbol)
14
{
15
return
symbol
switch
16
{
17
IMethodSymbol m =>
new
MethodExporter(m),
18
INamedTypeSymbol { TypeKind: TypeKind.Enum } t =>
new
EnumExporter(t),
19
INamedTypeSymbol t =>
new
TypeExporter(t),
20
_ =>
throw
new
NotSupportedException(
21
$
"{symbol.GetType().Name}({symbol.ToDisplayString()}) couldn't be exported"
)
22
};
23
}
24
}
Lilac.Generator.Exporters.IExporter
Definition
IExporter.cs:9
Lilac.Generator.Exporters.IExporter.Create
static IExporter Create(ISymbol symbol)
Definition
IExporter.cs:13
Lilac.Generator.Exporters.IExporter.GenerateUnmanagedCode
void GenerateUnmanagedCode(IndentedTextWriter source, IndentedTextWriter header)
Lilac.Generator.Exporters.IExporter.GenerateManagedCode
void GenerateManagedCode(IndentedTextWriter builder)
Lilac.Generator.Exporters
Definition
EnumExporter.cs:4
langs
csharp
frontend
src
Lilac.Generator
Exporters
IExporter.cs
Generated on Sat Oct 5 2024 07:56:20 for LILAC by
1.12.0