An open API service indexing awesome lists of open source software.

https://github.com/octopusdeploy/ocl

| Public | A HCL serialization library for .NET
https://github.com/octopusdeploy/ocl

public

Last synced: 5 months ago
JSON representation

| Public | A HCL serialization library for .NET

Awesome Lists containing this project

README

          

# Octopus Configuration Language (OCL)

The serialization library for the Octopus Configuration Language (OCL).

## Syntax

### EBNF

See [EBNF notation](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form).

```ebnf
newline = "\n" | "\r\n"

name = { non_whitespace }

integer = { digit }
decimal = integer, ".", integer
string = double_quote, { not_a_double_quote }, double_quote

empty_array = "[", "]"
string_array = "[", { string }, "]"
decimal_array = "[", { decimal }, "]"
integer_array = "[", { integer }, "]"

literal = string | heredoc | decimal | integer | empty_array | string_array | decimal_array | integer_array

dictionary_key = string | { not_a_double_quote_or_whitespace }
dictionary_entry = dictionary_key, "=", literal
dictionary = "{", newline, [ dictionary_entry, newline ], "}", newline

label = string

attribute = name, "=", literal | dictionary

block = name, { label }, "{", newline, [ body, newline ], "}", newline

body = { block | attribute }
document = body
```

### Names

Names identify a block or attribute. A Name can consist of any non-whitespace character.

Names do not need to be unique. Attributes with the same name in the same block as another attribute or block
is generally *not* supported by the target schema. Blocks with the same name are common as that is the way to define
lists of complex types.

### Numbers

`integers` and `decimals` are supported.

Exponential syntax (i.e. `1e6`) is not supported

e.g.
```hcl
int_attribute = 1
decimal_attribute = 1.3
```

### Quoted String

String can be declared by placing it between two `"` characters.

Special character escaping is currently not supported. Therefore the string cannot contain a `"`.

### Heredoc

Strings can also be declared by using the Heredoc syntax. `<<` starts the heardoc block, followed by the "tag", which is one or more
non-whitespace characters. This tag, when it appears on a line by itself (other than whitespace) denotes the end of the block. All lines
between the start and end lines are taken verbatim as the string value.

Escaping of characters is not support and is not required.

e.g.
```hcl
string_attribute = <