NAME ^

PAST - Abstract syntax tree nodes for tcl expressions.

DESCRIPTION ^

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

    PAST::Node           - base class for all ast nodes

    PAST::DynamicCommand - a (dynamic) tcl command to be evaluated
    PAST::StaticCommand  - a (static) tcl command to be evaluated
    PAST::Cond           - a conditional expression
    PAST::Op             - a operation
    PAST::MathFunc       - a math function
    PAST::Val            - a constant value
    PAST::Var            - a variable

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