procedure ConcatArgs( Cur:P_TPARGUMENT; var Buf: string );
{Func - Concatenate the lexemes of all the (sub)arguments pointed to by "Cur". }
begin
    Buf := Buf + Cur^._Lexeme;

    { Iterate through the children }
    if Cur^._Child <> NIL then
        begin
        ConcatArgs(Cur^._Child, Buf);
    end;

    { go to the sibling argument records }
    if Cur^._Next <> NIL then
        begin
        ConcatArgs(Cur^._Next, Buf);
    end;
end;

 

 

info@trinc-prolog.com