четверг, 7 октября 2010 г.

Added Procedural Types

Added procedural Types to YAR Language
Extend .NET codegen by MSIL calli instruction

Sample

TMyFunc=function(a:integer):integer;
TXfunc=function(var a:double):TMyFunc;

function abc(a:integer):integer;
begin
result:=a;
end;

function abc(var a:double):TMyFunc;
begin
result:=abc;
end;

e:double;
f:integer;
g:TXfunc;

begin
g:=abc;
f:=g(e)(f);
end

=>

.method static public void main() cil managed
{
.entrypoint
ldftn native int abc(float64& a)
stsfld native int g
ldsfld int32 f
ldsflda float64 e
ldsfld native int g
calli native int (float64& a)
calli int32 (int32 a)
stsfld int32 f
ret
}

Комментариев нет: