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

Behavior of PAST compiler

2 views
Skip to first unread message

Bernhard Schmalhofer

unread,
Mar 14, 2005, 5:51:13 PM3/14/05
to perl6-i...@perl.org
Hi,

I have been adding a PIR implementation and three 'Hello World' tests to
'languages/parrot_compiler'.
Code is taken from STDIN, compiled by a builtin compiler, and the resulting
Eval PMC
is invoked. This works as expected for PASM and PIR.

For PAST, Parrot abstract syntax tree as simple text, I get behavior that I
don't understand:

cd languages/parrot_compiler/
make
make test
cd ../../
./parrot languages/parrot_compiler/parrot_compiler.imc --language=PAST <
languages/parrot_compiler/t/basic/hello_3.code
./parrot languages/parrot_compiler/parrot_compiler.pbc --language=PAST <
languages/parrot_compiler/t/basic/hello_3.code

Calling 'parrot_compiler.imc' gives the expected result "Hello Pirate".
Calling 'parrot_compiler.pbc' seems to print the generated PASM code. It
looks like
the compiled sub knows whether it is being rum by PIR or by PBC.

Is that that the intended behavior?

CU, Bernhard

--
/* Bernhard.S...@biomax.de */

SMS bei wichtigen e-mails und Ihre Gedanken sind frei ...
Alle Infos zur SMS-Benachrichtigung: http://www.gmx.net/de/go/sms

Leopold Toetsch

unread,
Mar 15, 2005, 9:00:18 AM3/15/05
to Bernhard Schmalhofer, perl6-i...@perl.org
Bernhard Schmalhofer <Bernhard.S...@gmx.de> wrote:
> Hi,

> ./parrot languages/parrot_compiler/parrot_compiler.pbc --language=PAST <
> languages/parrot_compiler/t/basic/hello_3.code

> Calling 'parrot_compiler.pbc' seems to print the generated PASM code

Yes. When you run the .imc version of the program, C<emit_open> is
called in imcc/main.c:526, which sends the output to the to be generated
PBC. If you run the .pbc version of your compiler, the emit_open()
function isn't executed and the default emitter (number 0) is used,
which produces assembly listings (as parrot -o- does).

> Is that that the intended behavior?

The problem is that such output options can't be passed on to secondary
compile runs. They use just what imcc/main used. We probably need a
scheme to pass options from the C<compile> opcode to the compiler.

> CU, Bernhard

leo

0 new messages