Data Definition Language
1 Introduction
This document is the specification of the Data Definition Language. Programs of this language are sets of UTF8 files of this language and describe structured data for the purpose of for exchanging that data between entities (humans and machines alike). The language provides scalar types (boolean type, number type, string type, and void type) as well as aggregate types (map values and list values).
The language is insipired by JSON (see ECMA-404 The JSON interchange syntax, 2nd edition, December 2017 for more information). A conversion between JSON and DDL is possible without the loss of data.
2 Lexical Specification
The lexical specification of the Data Definition Language is based on the Common Lexical Specification
(see https://michaelheilmann.com/specifications/common-lexical-specification for more information).
The Data Definition Language lexical specification profile is obtained by adjusting the definition of the
The syntactical grammar describes the translation of the words into sentences. The goal non-terminal of the syntactical grammar is the sentence The words The goal sentence The sentence The sentence The sentence The sentence The sentence The sentence The sentence
The <Data Definition Language language describes structured data in terms of typed values.
That is, each sentence of the syntactical specification translates to values each of which has type.
The Data Definition Language knows six basic types
The type
The type Example
The type
A Example If two map entries of the same Example
The following Data Definition Language program defines a
This is a semantical error.
The type
The type
The type
The type Lexical.Word of the
Lexical.Word : Lexical.Boolean
Lexical.Word : Lexical.Number
Lexical.Word : Lexical.String
Lexical.Word : Lexical.Void
Lexical.Word : Lexical.Name
Lexical.Word : Lexical.LeftCurlyBracket
Lexical.Word : Lexical.RightCurlyBracket
Lexical.Word : Lexical.LeftSquareBracket
Lexical.Word : Lexical.RightSquareBracket
Lexical.Word : Lexical.Comma
/*whitespace, newline, and comment are not considered the syntactical grammar*/
Lexical.Word : Lexical.Whitespace
Lexical.Word : Lexical.Newline
Lexical.Word : Lexical.Comment
3 Syntactical Specification
syn:Sentence symbol.lex:Whitespace and lex:LineTerminator are removed from the sequence of words before the translation to sentences is performed.syn:Sentence is defined by
syn:Sentence : syn:Value
syn:Value is defined by
syn:Value : syn:Map
syn:Value : syn:List
syn:Value : syn:String
syn:Value : syn:Number
syn:Value : syn:Boolean
syn:Value : sny:Void
syn:String is defined by
syn:String : lex:String
syn:Number is defined by
syn:Number : lex:Number
syn:Boolean is defined by
syn:Boolean : lex:Boolean
syn:Void is defined by
syn:Void : lex:Void
syn:Map is defined by
syn:Map : lex:LeftCurlyBracket
syn:MapBody
lex:RightCurlyBracket
syn:MapBody : syn:MapBodyElement syn:MapBodyRest
syn:MapBody : ε
syn:MapBodyRest : lex:Comma syn:MapBodyElement syn:MapBodyRest
syn:MapBodyRest : lex:Comma
syn:MapBodyRest : ε
syn:MapBodyElement : lex:Name lex:Colon syn:Value
syn:List is defined by
syn:List : lex:LeftSquareBracket
syn:ListBody
lex:RightSquareBracket
syn:ListBody : syn:ListBodyElement syn:ListBodyRest
syn:ListBody : ε
syn:ListBodyRest : lex:Comma syn:ListBodyElement syn:ListBodyRest
syn:ListBodyRest : lex:Comma
syn:ListBodyRest : ε
syn:ListBodyElement : syn:Value
4 Semantical Specification
4.1 Boolean Type
4.2 List Type
// A list with three numbers 1, 2, and 3.
[ 1, 2, 3 ]
4.3 Map Type
// A map of
// text to 'Hello, World!'
// action to 'Print', and
// fontSize to 12.
{ text : 'Hello World!', action : 'Print', fontSize: 12 }
{ x : 0, x : 1 }
4.4 Number Type
Data Definition Language does not impose restrictions on the size of the literals or the values.
Implementations, however, may impose restrictions.
4.5 String Type
4.6 Value Type
4.7 Void Type