develooper Front page | perl.perl6.internals.api.parser | Postings from November 2000

Re: The external interface for the parser piece

Thread Previous | Thread Next
From:
Steve Fink
Date:
November 28, 2000 15:31
Subject:
Re: The external interface for the parser piece
Message ID:
3A24401E.F49ED524@digital-integrity.com
Dan Sugalski wrote:
> 
> Sure. Suggestions?

int perl6_parse(PerlInterp* interp, PerlIO* input);
PerlIO* make_memory_stream(char* buf, ssize_t length); // length=-1 for
nul-terminated
int close_stream(PerlIO* stream);

then if you read further, you'll eventually see:

PerlIO* make_callback_stream(int (*f)(char* buf, int space, void*
other), void* other);

Or maybe the first thing you see is just:

int perl6_parse_string(PerlInterp* interp, char* buf, ssize_t length);
// length=-1 for nul-term

if that really is 95% of the cases.

I guess I just think that when discussing perl6_parse, it's less effort
to mention the existence of make_memory_stream and close_stream than it
is to explain the meaning of three mystery parameters. Especially if
that knowledge can be reused for half a dozen other API calls. 

perl6_Scalar* perl6_eval_scalar(PerlInterp*,PerlIO*);
perl6_List* perl6_eval_list(PerlInterp*,PerlIO*);
int perl6_load_module(PerlInterp*, PerlIO*); // Checks magic number for
.pm vs .pmc, BOM, gzip...

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About