NAME ^

PAST - Abstract syntax tree nodes for APL

DESCRIPTION ^

This file implements the various abstract syntax tree nodes needed for APL. The currently defined ast nodes:

    PAST::Node       - base class for all ast nodes
    PAST::Stmts      - a block of statements
    PAST::Stmt       - a single statement
    PAST::Op         - an APL operation
    PAST::Val        - a constant value
    PAST::Var        - a variable
    PAST::Vector     - a vector of values
    PAST::Assign     - an assignment operation

The PAST::Node class itself is derived from Hash, so that it's easy to store and retrieve attributes from each node object.

PAST functions ^

__onload()

Creates the PAST::* classes.

PAST::Node methods ^

__init()

Initializes a new PAST::Node object.

set_node(PMC match)

Initializes the current ast node with the source code information from a match object (presumably a component of the parse tree).

source()

Return the source code associated with the current node.

pos()

Return the source code offset associated with this node.

__dump(PMC dumper, STR label)

Display the contents of the current node in a form compatible with Data::Dumper.

LICENSE ^

Copyright (C) 2005-2006, The Perl Foundation.

This is free software; you may redistribute it and/or modify it under the same terms as Parrot.


parrot