Package pology :: Module synder

Module synder

Derive forms and properties of syntagmas by macro expansion.

This module provides facilities for macro derivations on syntagmas. It consists of two elements: the text format for defining macro derivations, and the derivator class which reads and processes these definitions. The derivator class is documented within this module, while the syntax and semantics of syntagma derivations are documented in the user manual, at doc/user/lingo.docbook#sec-lgsynder.


Author: Chusslove Illich (Часлав Илић) <caslav.ilic@gmx.net>

License: GPLv3

Classes
  SynderError
  Synder
Derivator objects import sources of derivations and get queried for properties of syntagmas.
Functions
 
empty_source_cache()
Clear all cached sources.
bool
compile_file(path, cpath=None, doraise=False)
Import file with derivations.
Variables
  __package__ = 'pology'
Function Details

empty_source_cache()

 

Clear all cached sources.

When file with derivations is loaded, its parsed form is cached, such that future load instructions on that same path (e.g. when the path is included from another file) do not waste any extra time and memory. This function erases all sources from the cache, when loading files anew on future load instructions is desired.

compile_file(path, cpath=None, doraise=False)

 

Import file with derivations.

If the compile file path cpath is not given, it is constructed as path plus standard extension suffix.

If the file cannot be compiled, the behavior depends on doraise. If doraise is False, a warning is reported to standard error; if doraise is True, an SynderError exception is raised.

Parameters:
  • path (string) - the path to file to compile
  • cpath (string) - the path to compiled file
Returns: bool
True if the file was successfully compiled