public ArrowExpressionClauseCompiler(IArrowExpressionClause arrowExpressionClause, AbstractILCompilerParams @params) : base(@params) { myArrowExpressionClause = arrowExpressionClause; switch (myArrowExpressionClause.Parent) { case IPropertyDeclaration propertyDeclaration: var name = $"get_{propertyDeclaration.DeclaredName}"; MyParams.CreateMethod(null, name); IsMethod = true; break; case IMethodDeclaration _: case ILocalFunctionDeclaration _: case IAccessorDeclaration _: case IConstructorDeclaration _: case IIndexerDeclaration _: IsMethod = false; break; default: throw MyParams.CreateException( $"parent of ArrowExpression is {myArrowExpressionClause.Parent?.GetType()}"); } }
public LocalFunctionDeclarationCompiler(ILocalFunctionDeclaration localFunctionDeclaration, AbstractILCompilerParams @params) : base(@params) { myLocalFunctionDeclaration = localFunctionDeclaration; MyParams.CreateMethod(myLocalFunctionDeclaration.DeclaredElement); }
public AccessorDeclarationCompiler(IAccessorDeclaration accessor, AbstractILCompilerParams myParams) : base(myParams) { myAccessor = accessor; MyParams.CreateMethod(accessor.DeclaredElement); }
public MethodDeclarationCompiler(IMethodDeclaration methodDeclaration, AbstractILCompilerParams @params) : base(@params) { myMethodDeclaration = methodDeclaration; MyParams.CreateMethod(myMethodDeclaration.DeclaredElement); }
public ConstructorDeclarationCompiler(IConstructorDeclaration constructorDeclaration, AbstractILCompilerParams @params) : base(@params) { myConstructorDeclaration = constructorDeclaration; MyParams.CreateMethod(constructorDeclaration.DeclaredElement); }