forked from MochiLibraries/Biohazrd
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCSharpTransformationBase.cs
21 lines (18 loc) · 1.13 KB
/
CSharpTransformationBase.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
using Biohazrd.Transformation;
namespace Biohazrd.CSharp
{
public abstract class CSharpTransformationBase : TransformationBase
{
protected override TransformationResult Transform(TransformationContext context, TranslatedDeclaration declaration)
=> declaration switch
{
ConstantArrayTypeDeclaration constantArrayTypeDeclaration => TransformConstantArrayType(context, constantArrayTypeDeclaration),
SynthesizedLooseDeclarationsTypeDeclaration synthesizedTypeDeclaration => TransformSynthesizedLooseDeclarationsType(context, synthesizedTypeDeclaration),
_ => base.Transform(context, declaration)
};
protected virtual TransformationResult TransformConstantArrayType(TransformationContext context, ConstantArrayTypeDeclaration declaration)
=> TransformDeclaration(context, declaration);
protected virtual TransformationResult TransformSynthesizedLooseDeclarationsType(TransformationContext context, SynthesizedLooseDeclarationsTypeDeclaration declaration)
=> TransformDeclaration(context, declaration);
}
}