PCLT-0.1: Extension to Show: templating, catalogizing, languages, parameters, etc.




Here are declared LocalizableTemplate (also called PCLT) and LocalizedTemplate. Here by localization is meant localization in languages. First (localizable template) is above languages, while second (localized template) is a template version in a concrete language.


Template pieces

listOfParams :: LngTpl_AbstractedString -> [ParamName_LBS]Source

Extract a list of parameter names from a template content.

Parsing from a lazy ByteString to a localized template content

doTheParse :: PCLT_InnerConfig -> ByteString -> ([PCLT_ParserLowLevelFailure], Maybe (LngTpl_AbstractedString, [PCLT_CompositeKey]))Source

The parsing uses parameters Test.PCLT.Config.pcsParameterPlaceholderWrapper and Test.PCLT.Config.pcsCompositePlaceholderWrapper of Test.PCLT.Config.PCLT_InnerConfig. The list [PCLT_CompositeKey] in the result is a list of composite keys (template IDs, used by template as inclusions)

Localized template

data LocalizedTemplate Source




ldtAbstractedString :: LngTpl_AbstractedString
ldtSubcompositesMap :: LngTpl_SubCompositesMap

Each composition tree is kept together with each localization. This is done for speedup and is a source of complexities, when forming a catalog and sustaining it's data consistency. So it comes to this: templates are purely-referenced by

By "purely-reference" here is meant, that templates are formed only once, they have one instace in memory, but are referenced twice - from composeds and from catalog map


Requirement for making a representation from template - SDL

data PCLT_ShowDetalizationLevel Source

This is an extending wrapper around SDL. It is used for specification of requirement for making representation from template. This specification is attached to every localizable template in PCLT catalog


PCLT_SDL ShowDetalizationLevel

Plain SDL, nominal. If SDL of representation reciever is less then that, then template cann't be used in representation generation.


"The requirement is the same as is specified for referenced template".

PCLT_SDL_ToParamCompositeLink PCLT_ParamKey

"The requirement is the same as is specified a for referenced template, which is referenced by a PCSI_PV value of referenced parameter (of current template)".

PCLT_SDL_Errornous PCLT_ErrornousSDL

In input data for catalog formation the given specification is errornous. If config's (Text.PCLT.Config) parameters pcsAllowEmptySDL_parseItByModusMargin and/or pcsAllowUnreadableSDL_parseIdByModusMargin are positive, then instead of PCLT_SDL_Errornous the parser (str2PCLT_SDL) will use marginOfSDLModus to set valid specification. When representation generator meets PCLT_SDL_Errornous it won't use template, and return an error.

data PCLT_RawCatalogData Source

Raw templates (both localizeds, and localizables). Input data for catalog formation. Used by HasStaticRawPCLTs class (declared in Text.PCLT.HasStaticRawPCLTs)

__const_esdl_rawinputshowsize_inShowAsPCSI :: IntSource

A constant currently set to 25. It is used in a parser str2PCLT_SDL: if the input is errornous, this much symbols of input are saved in UnreadableSDL_ESDL. If input is bigger, then the saved trunc is tailed with "..."

str2PCLT_SDL :: SDLModus -> String -> PCLT_InnerConfig -> PCLT_ShowDetalizationLevelSource

Parse String into PCLT_ShowDetalizationLevel. First of all parser tries strict_str2sdl. Then, if failed, parser uses following config entries:

Localizable template

data LocalizableTemplate Source




pcltLocalizationsMap :: Map LanguageName LocalizedTemplate
pcltRequiredSDL :: PCLT_RequiredShowDetalizationLevel

If SDL of representation reciever is less then that, then template cann't be used in representation generation.