Menu

Grammar

LabRAD Grammar (beta version)

Overview

The LabRAD Grammar describes in EBNF the LabRAD Type Tags (including Units) used to specify the format of LabRAD data.

Rules

anything= ? Any character: 0x00 .. 0xFF ?
array= "*", [ dimensions ], arraytag
arraytag= [ comment ], ( basic | cluster | unknownempty ), [ comment ]
base= basechar, { basechar }
basechar= letters | "º" | "'" | '"' | "µ"
basic= "b" | "i" | "w" | "s" | value | complex | "t"
cluster= "(", [ comment ], tag, { tag }, ")"
comment= { ignored }, { "{", commentstring, "}", { ignored } }
commentchar= anything - "}"
commentstring= commentchar, { commentchar }
complex= "c", [ units ]
digit= "0" | nonzerodigit
dimensions= number
end= ":", { anything }
error= "E", [ comment ], [ tag ], [ end ]
exponent= [ comment ], [ sign ], fraction
fraction= numberorzero, [ comment ], [ "/", [ comment ], number ]
ignored= space | tab | "," | ";"
letters= letterscaps | letterslower
letterscaps= "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z"
letterslower= "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z"
nonzerodigit= "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"
number= nonzerodigit, { digit }
numberorzero= number | "0"
sign= "+" | "-"
space= " "
tab= ? TAB character: 0x09 ?
tag= ( basic | cluster | array ), [ comment ]
typetag= error | ( [ comment ], { tag } , [ end ] )
unit= base, [ comment ], [ "^", exponent ]
units= "[", unitstring, "]"
unitstring= [ comment ], ( "1" | unit ), { ( "*" | "/" ), unit }
unknownempty= "_"
value= "v", [ units ]

Note:
This information is not fully verified yet. I am neither convinced that this grammar is complete, self consistent, and makes sense, nor am I sure that the manager implements it in this exact form. It should be roughly correct, but I will have to thoroughly check this. If you have any comments, please let us know.

 

~ Markus Ansmann, Dec 13, 2007


Related

Wiki: DataTypes
Wiki: Units