Class Translet

java.lang.Object
eu.bandm.tscore.base.Translet

public class Translet extends Object
Base class for constructing user defined parsers by combinators; originally for the values contained in the different parameter tracks of a tscore voice. The parser description is a "fully formandum domain specific language", i.e. the elements of the syntax are Java language level objects and their references.

The application to a track of a timescape model is done by calling a utility function from Util.

The static factory methods in this class realize combinators for the construction of parsers. Some specialized basic parsers can be found in TransletLib; instructive examples can be found in MaWiCM etc.; see also the user documentation.

Implementation:
Parsing is done in brute-force breadth-first, which is feasible thanks to relatively small input sizes. Error diagnosis is included as first-class resident by collecting all failed attempts, in parallel to the successful. This is realized by all functions operating on a SET of Translet.State, each representing such a parsing hypothesis.

The type parameter of any Translet.Parser is the type of its result. This type is the fundamental means to direct or reject all combinator applications. It is extensively checked by all static combinator methods, including the store operations which deliver the final conversion results for further processing. This strategy heavily contributes to the overall type safety of the resulting network. Furthermore, types are mostly inferred when using the static constructor methods, which increases compactness and elegance of notation.

The Translet.State object duplicates the type parameter of the related parser.