Please, input source code:
program Example1(Input, Output); { closure syntax of old style pascal (NOT Borland style) } function Integrate(First, Last, Delta: Real; function F(X: Real): Real): Real; var I, J: Real; begin Result := 0; { ...sorry, "Result" is Borland style :-) } I := First; while I < Last do begin J := I + Delta; if J > Last then J := Last; Result := Result + (F(I) + F(J)) * (J - I) / 2; I := J end end; begin WriteLn(Integrate(- PI / 2, + PI / 2, 0.01, Sin)) end.
View source code of this parser.