yamlr: Processing of YAML markup

Description Details YAML syntax Processing YAML markup Identifying/retrieving YAML markup Parsing YAML markup Building expressions from YAML markup Update original object that contained YAML markup Classes and constructors Author(s) References

Description

Useful functionality to identify, parse and process YAML markup.

Details

The package aims at providing a general interface for processing YAML markup in a flexible and extendable manner based on the S4 Methods mechanism.

To realize a generic approach, the basic workflow method getYaml takes two arguments:

  1. from: An object containing YAML markup

  2. ctx: An object denoting the application context.

    Currently available contexts:

    • YamlContext.ObjectReference.S3

YAML syntax

Note that the YAML statement for specifying object references must be as follows:

object-ref: {id: {id}, where: {where}, as: {id-ref}}

Note that elements where and as are optional and that spaces are required between each syntax component. While the lack of spaces will cause a parsing error in yaml.load, additional spaces do not casue any trouble.

Example for valid YAML statements

See the official http://www.yaml.org/ for more details about YAML

Processing YAML markup

Function processYaml:

This is the main top-level function for using this package. It is wrapper around the sequential execution of

Takes an object that contains YAML markup and then processes it eventually resulting in updating the underlying object so that it can be used/executed.

Currently available methods:

Identifying/retrieving YAML markup

Function getYaml:

Takes an object that contains YAML markup and then tries to identify and retrieve the actual markup.

Currently available methods:

Parsing YAML markup

Function parseYaml:

Takes an object as returned by getYaml and parses it.

Currently available methods:

Building expressions from YAML markup

Function buildExpressionFromYaml:

Takes an object as returned by parseYaml and builds suitable expressions based on the provided YAML markup.

Currently available methods:

Update original object that contained YAML markup

Function updateYamlSource:

Takes an object as returned by buildExpressionFromYaml and updates the underlying source object in order to substitute the YAML markup by suitable expressions to make the object fully self-contained.

Currently available methods:

Classes and constructors

The package defines the following S3 classes (in order of their workflow usage):

NOTE

S3 classes are generally used for speeding up rapid prototyping. It is possible that these classes are transformed to actual S4 classes at some point

Author(s)

Janko Thyson janko.thyson@rappster.de

References

http://github.com/Rappster/yamlr


rappster/yamlr documentation built on May 27, 2019, 2:02 a.m.