Bases: object
Abstract base class for a PFA abstract syntax tree.
Walk over tree applying a partial function, returning a list of results in its domain.
Parameters: |
|
---|---|
Return type: | list of function results |
Returns: | a result for each abstract syntax tree node in the pf function’s domain |
Convert this abstract syntax tree to Pythonized JSON.
Parameters: |
|
---|---|
Return type: | Pythonized JSON |
Returns: | JSON representation |
Walk over tree applying a partial function, returning a transformed copy of the tree.
Parameters: |
|
---|---|
Return type: | new titus.pfaast.Ast tree |
Returns: | tree with nodes in the pf function’s domain transformed; everything else left as-is |
Helper function to build a Pythonized JSON object.
Parameters: | lineNumbers (bool) – if True, include the locator mark |
---|---|
Return type: | OrderedDict |
Returns: | an empty Pythonized JSON object or one containing only the locator mark |
Serialize this abstract syntax tree as a JSON string.
Parameters: | lineNumbers (bool) – if True, include locator marks at the beginning of each JSON object |
---|---|
Return type: | string |
Returns: | JSON string |
Walk over tree applying a titus.pfaast.Task while checking for semantic errors.
This is how Python is generated from an abstract syntax tree: the titus.pfaast.Task in that case is titus.genpy.GeneratePython.
Parameters: |
|
---|---|
Return type: | (titus.pfaast.AstContext, titus.pfaast.TaskResult) |
Returns: | (information about this abstract syntax tree node after type-checking, result of the generic task) |