Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
structured fields blab
sf {
sf-string = DQUOTE chr* DQUOTE
sf-list = list-member ( OWS "," OWS list-member )*
list-member = sf-item
| inner-list
inner-list = "(" SP* ( sf-item ( SP+ sf-item )* SP* )? ")" parameters
parameters = ( ";" SP* parameter )*
parameter = param-name ( "=" param-value )?
param-name = key
key = lcalpha | "*" ( lcalpha | DIGIT | "_" | "-" | "." | "*" )*
lcalpha = "z" | "y" | "x" | "w" | "v" | "u" | "t" | "s" | "r" | "q" | "p" | "o" | "n" | "m" | "l" | "k" | "j" | "i" | "h" | "g" | "f" | "e" | "d" | "c" | "b" | "a"
param-value = bare-item
sf-dictionary = dict-member ( OWS "," OWS dict-member )*
dict-member = member-name ( "=" member-value )?
member-name = key
member-value = sf-item
| inner-list
sf-item = bare-item parameters
bare-item = sf-integer
| sf-decimal
| sf-string
| sf-token
| sf-binary
| sf-boolean
sf-integer = ( "-" )? DIGIT{1,15}
sf-decimal = ( "-" )? DIGIT{1,12} "." DIGIT{1,3}
chr = unescaped
| escaped
unescaped = "!" | " "
| "[" | "Z" | "Y" | "X" | "W" | "V" | "U" | "T" | "S" | "R" | "Q" | "P" | "O" | "N" | "M" | "L" | "K" | "J" | "I" | "H" | "G" | "F" | "E" | "D" | "C" | "B" | "A" | "@" | "?" | ">" | "=" | "<" | ";" | ":" | "9" | "8" | "7" | "6" | "5" | "4" | "3" | "2" | "1" | "0" | "/" | "." | "-" | "," | "+" | "*" | ")" | "(" | "\'" | "&" | "%" | "$" | "#"
| "~" | "}" | "|" | "{" | "z" | "y" | "x" | "w" | "v" | "u" | "t" | "s" | "r" | "q" | "p" | "o" | "n" | "m" | "l" | "k" | "j" | "i" | "h" | "g" | "f" | "e" | "d" | "c" | "b" | "a" | "`" | "_" | "^" | "]"
escaped = "\\" ( DQUOTE | "\\" )
sf-token = ALPHA | "*" ( tchar | ":" | "/" )*
sf-binary = ":" ":"
base64 = ALPHA
| DIGIT
| "+"
| "/"
| "="
sf-boolean = "?" boolean
boolean = "0"
| "1"
tchar = "!"
| "#"
| "$"
| "%"
| "&"
| "\'"
| "*"
| "+"
| "-"
| "."
| "^"
| "_"
| "`"
| "|"
| "~"
| DIGIT
| ALPHA
OWS = ( SP | HTAB )*
VCHAR = "~" | "}" | "|" | "{" | "z" | "y" | "x" | "w" | "v" | "u" | "t" | "s" | "r" | "q" | "p" | "o" | "n" | "m" | "l" | "k" | "j" | "i" | "h" | "g" | "f" | "e" | "d" | "c" | "b" | "a" | "`" | "_" | "^" | "]" | "\\" | "[" | "Z" | "Y" | "X" | "W" | "V" | "U" | "T" | "S" | "R" | "Q" | "P" | "O" | "N" | "M" | "L" | "K" | "J" | "I" | "H" | "G" | "F" | "E" | "D" | "C" | "B" | "A" | "@" | "?" | ">" | "=" | "<" | ";" | ":" | "9" | "8" | "7" | "6" | "5" | "4" | "3" | "2" | "1" | "0" | "/" | "." | "-" | "," | "+" | "*" | ")" | "(" | "\'" | "&" | "%" | "$" | "#" | "\"" | "!"
SP = " "
HTAB = "\t"
DIGIT = "9" | "8" | "7" | "6" | "5" | "4" | "3" | "2" | "1" | "0"
ALPHA = "Z" | "Y" | "X" | "W" | "V" | "U" | "T" | "S" | "R" | "Q" | "P" | "O" | "N" | "M" | "L" | "K" | "J" | "I" | "H" | "G" | "F" | "E" | "D" | "C" | "B" | "A"
| "z" | "y" | "x" | "w" | "v" | "u" | "t" | "s" | "r" | "q" | "p" | "o" | "n" | "m" | "l" | "k" | "j" | "i" | "h" | "g" | "f" | "e" | "d" | "c" | "b" | "a"
DQUOTE = "\""
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.