PIL nodes - looking for descriptions

2 views
Skip to first unread message

Allison Randal

unread,
Jul 25, 2005, 3:57:07 PM7/25/05
to perl6-c...@perl.org
I'm looking for descriptions of the kinds of nodes in PIL. Below is
what I gathered from digging through the source code (Compile.hs and
Compile/PIR.hs). Could one of the lamdas correct the places where I'm
misinterpreting the code and fill in what's missing?

--------
PNil A null value?
PVal A literal value
PVar A variable

PNoop No-op
PAssign Assignment operation
PBind Binding operation
PApp All other operations, function calls, or method calls

PSub A subroutine declaration
PCode A code block

PExp An expression
PStmt A statement
PStmts A sequence of statements

PLit An intermediate node for literal values?
PRawName An intermediate node for variable names?
PThunk An intermediate node? No semantic value?

PPad Create a new pad (or add a new element to a pad?)
PPos ?
--------

Thanks!
Allison

Stuart Cook

unread,
Jul 26, 2005, 1:02:47 AM7/26/05
to perl6-c...@perl.org
On 7/26/05, Allison Randal <all...@perl.org> wrote:
> I'm looking for descriptions of the kinds of nodes in PIL. Below is
> what I gathered from digging through the source code (Compile.hs and
> Compile/PIR.hs). Could one of the lamdas correct the places where I'm
> misinterpreting the code and fill in what's missing?

I was planning on making a list of these recently, but I was too
busy/lazy to actually get around to asking Autrijus. I would also be
interested in getting proper descriptions (and putting them in the
documentation), but for now, here are some of my own notes:

> --------
> PNil A null value?

PNil seems to be a list-terminator for PStmts lists (Lisp-style).

> PThunk An intermediate node? No semantic value?

I believe this is used for computations that need to be performed
lazily, such as the consequent of a conditional (if, unless) or the
arguments to a lazy logical operator (||, && and friends).

> PPos ?
This surrounds other PIL nodes with a 'position' wrapper, telling us
the name of the source file (as well as line and column numbers) for
the code that produced the nodes.


Of course, these are all based on my own reading of the code -- I
never did check whether they were correct, so don't take them as
gospel!


Stuart

Patrick R. Michaud

unread,
Jul 25, 2005, 4:10:41 PM7/25/05
to Allison Randal, perl6-c...@perl.org
On Mon, Jul 25, 2005 at 12:57:07PM -0700, Allison Randal wrote:
> Could one of the lamdas correct the places where I'm
> misinterpreting the code and fill in what's missing?

I may be able to help a little -- PPos indicates the current
parse location in the source code (for issuing useful debugging
messages). A PThunk is a lazily-evaluated something (I think).
But a lambda camel would know with more certainty than I about
this at the moment.

Pm

Reply all
Reply to author
Forward
0 new messages