Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

HLL type mappings and PIR

0 views
Skip to first unread message

Roger Browne

unread,
Oct 11, 2005, 7:13:26 AM10/11/05
to perl6-i...@perl.org
In a PMC you can set and use HLL type mappings using these calls:

Parrot_get_HLL_id
Parrot_register_HLL_type
Parrot_get_ctx_HLL_type

I've been using these in some experimental PMCs, with good results.

Is there any way to set and use these HLL type mappings from PIR?

Regards,
Roger Browne


Leopold Toetsch

unread,
Oct 11, 2005, 7:36:03 AM10/11/05
to Roger Browne, perl6-i...@perl.org

Not yet. Syntax proposals welcome.

> Regards,
> Roger Browne

leo

Roger Browne

unread,
Oct 11, 2005, 8:37:24 AM10/11/05
to perl6-i...@perl.org
> > Parrot_get_HLL_id
> > Parrot_register_HLL_type
> > Parrot_get_ctx_HLL_type
> > ...Is there any way to set and use these HLL type mappings from PIR?

>
> Not yet. Syntax proposals welcome.

Um, 3 new opcodes?

get_lang_id(out INT, in STR)

Return an integer id $1 for the HLL named in $2.

For example:

.local int amber_id
amber_id = get_lang_id "Amber"

register_lang_type(in INT, in INT, in INT)

Register the type $3 as corresponding to the standard
Parrot type $2 when using the HLL whose id is in $1.

For example:

.local int amber_integer_type
amber_integer_type = find_type "Am_INTEGER"
register_lang_type amber_id, .Integer, amber_integer_type

get_lang_type(out INT, in INT)

Return the type $1 corresponding to the standard Parrot
type $S2 for the language currently set by the .HLL directive.

For example:

.local int lang_int_type
.local pmc p
lang_int_type = get_lang_type .Integer
p = new lang_int_type

Regards,
Roger Browne

0 new messages