0.0.0 • Published 12 months ago

sxd v0.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

sxd

SXD - Simple eXchange Dataformat?

Syntax

The general syntax for the SXD format is the following:

# This is a comment. Comments start with a '#' and the parser removes everything on the line after the '#'
# Comments must start with a space.

# Statements are the fundamental "building blocks".
STATEMENT

# Statements can have single arguments
STATEMENT(arg)

# Statements can have multiple arguments
STATEMENT(arg1, arg2, arg3, ...)

# Arguments can be passed "unknown" - using the ? character
STATEMENT(?, ...)

# Arguments can contain spaces
STATEMENT(this argument has spaces, this argument also has spaces)

# We can wrap arguments with quotes if they need to contain commas
STATEMENT("This argument can contain commas, which is nice", ...)

# If a quoted argument need to contain quotes, we can escape the characters
STATEMENT("This is so called \"trickery\"", ...)

# Statements can have free text
STATEMENT <Free Text>
STATEMENT(...) <Free Text>

# Statements can have a modifier, which are like special statements. The default modifier has no name
@[...]
STATEMENT(...) <Free Text>

# But we can also have named modifiers
@MODIFIER[...]
STATEMENT(...) <Free Text>

# Statements can have blocks
STATEMENT {
  <Block>
}
STATEMENT(...) {
  <Block>
}
STATEMENT(...) <Free Text> {
  <Block>
}

# Nested blocks are also allowed
STATEMENT(...) <Free Text> {
  STATEMENT(...) <Free Text> {
    <Block>
  }
}
0.0.0

12 months ago