Core API Reference

Paxter language package provides the following core functionality.

Parsing

The following class is where the main Paxter language parsing logic happens.

Data Definitions

Results of the Paxter language parsing yields parsed trees which consist of instances of the following data classes.

Other Utility Classes

Other classes related to parsing, presented here for reference only.

Interpretation

The following class implements the basic tree evaluation in Paxter language. Users may want to extend this class to override the tree evaluation.

The evaluated list of fragments will be of the following type

Function decorators

Wrappers for functions in python environments to be used as function decorators.


Exceptions

These are all the exception classes raised from this library package.

class paxter.exceptions.PaxterBaseException(message: str, **positions: CharLoc)[source]

Bases: Exception

Base exception specific to Paxter language ecosystem. Positional index parameters indicates a mapping from position name to its indexing inside the input text.

positions: dict[str, CharLoc]

A mapping from position name to LineCol position data

message: str

Error message

class paxter.exceptions.PaxterConfigError(message: str, **positions: CharLoc)[source]

Bases: paxter.exceptions.PaxterBaseException

Exception for configuration error.

class paxter.exceptions.PaxterSyntaxError(message: str, **positions: CharLoc)[source]

Bases: paxter.exceptions.PaxterBaseException

Exception for syntax error raised while syntax input text in Paxter language.

class paxter.exceptions.PaxterRenderError(message: str, **positions: CharLoc)[source]

Bases: paxter.exceptions.PaxterBaseException

Exception for parsed tree transformation error.