CLanguage by praeclarum

<PackageReference Include="CLanguage" Version="0.18.45" />

.NET API 203,776 bytes

 SizeOfExpression

public class SizeOfExpression : Expression
using CLanguage.Compiler; using CLanguage.Interpreter; using CLanguage.Types; using System.Runtime.CompilerServices; namespace CLanguage.Syntax { [System.Runtime.CompilerServices.NullableContext(1)] [System.Runtime.CompilerServices.Nullable(0)] public class SizeOfExpression : Expression { public Expression Query { get; set; } public SizeOfExpression(Expression query) { Query = query; } public override CType GetEvaluatedCType(EmitContext ec) { return CBasicType.UnsignedLongInt; } protected override void DoEmit(EmitContext ec) { Value x = Query.GetEvaluatedCType(ec).GetByteSize(ec); ec.Emit(OpCode.LoadConstant, x); } } }