Flip Unit Testing Language Guide

Language Reference

This chapter describes the Utml language in pseudo notation format.

Common elements

The following describes common elements used below.

Skip character

For every rule except when parsing the value of a blob, the skip character set are white spaces space, tab, cr, lf. This means in particular that an expression, except for blob value, might be spanned on multiple lines. In the following it will be assumed that symbols are separated by the skip character when matching a rule.

Class name

<class-name>

<class-name> represents a class name as declared in Flip. It follows Flip class name validation.

Member name

<member-name>

<member-name> represents an object member name as declared in Flip. It follows Flip object name validation.

Document

Document contains exactly one top level object, which represent the root of the document tree.

<document> = <top-level-object>

Top level objects

Top level objects are objects like the root object and every objects stored in a Flip container like Array or Collection.

<top-level-object> = <top-identifier> <content>
<top-identifier> = <class-name> [object-name]

A top level object has an optional name to be used with ObjectRef references.

Content

<content> = "{" 0*<member-definition> "}"
<member-definition> = <member-name> "=" <value>

The content of an object may contain zero or more member definition. This content may be used recursively as seen in the value defined below.

Value

The value type is dependent of the associated data model. As Flip read the Utml source, it will match it to the provided data model.

When a member definition is omited, the equivalent member definition is then implicitely defaulted. The default values are described below.

Bool

<value> = "true" | "false"

Default value is false.

Int

value represents an integer compatible with std::sscanf with the "%lld" format specifier.

Default value is 0.

Float

value represents an integer compatible with std::sscanf with the "%lf" format specifier.

Default value is 0.0.

ObjectRef

<value> = <object-name> 0*("." <member-name>)

Default value is a Ref::null Flip reference.

Blob or String

<value> = <value-string> | <value-hex> | <value-base64>
<value-string> = '"' <escaped-ascii> '"'
<value-hex> = "0x" <hexadecimal>
<value-base64> = "decode_b64" "(" <base64> ")"

Default value is an empty Blob.

Collection

<value> = "{" 0*<top-level-object> "}"

Default value is an empty Collection.

Array

<value> = "{" 0*<top-level-object> "}"

Default value is an empty Array.

Object member

<value> = "{" 0*<member-definition> "}"

Default value is an object which all members definition are defaulted, recursively.

Message

Message cannot be defined because they don't have a value.