Google Grup tidak lagi mendukung postingan atau langganan Usenet baru. Konten lama masih dapat dilihat.

HLL type mappings and PIR

0 kali dilihat
Langsung ke pesan pertama yang belum dibaca

Roger Browne

belum dibaca,
11 Okt 2005, 07.13.2611/10/05
kepadaperl6-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

belum dibaca,
11 Okt 2005, 07.36.0311/10/05
kepadaRoger Browne, perl6-i...@perl.org

Not yet. Syntax proposals welcome.

> Regards,
> Roger Browne

leo

Roger Browne

belum dibaca,
11 Okt 2005, 08.37.2411/10/05
kepadaperl6-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 pesan baru