(* This document defines the syntax of the FQL query language. The meta language used is extended Backus-Naur form as defined in ISO/IEC 14977 with two modifications: concatenation is implicit and rules terminate at newline. *) query = keyval | key | directory keyval = key '=' ws value key = directory tuple value = 'clear' | data directory = '/' ( '<>' | name | string ) [ directory ] tuple = '(' [ nl elements [ ',' ] nl ] ')' elements = '...' | ( data [ ',' nl elements ] ) data = 'nil' | variable | tuple | bool | int | float | string | uuid | bytes | vstamp variable = '<' [ type ] '>' type = ( 'tuple' | 'bool' | 'int' | 'float' | 'string' | 'uuid' | 'bytes' | 'vstamp' ) [ '|' type ] bool = 'true' | 'false' int = [ '-' ] number float = int '.' number [ 'e' int ] string = '"' { text | '\"' } '"' uuid = ( 8 * hexDigit ) '-' ( 4 * hexDigit ) '-' ( 4 * hexDigit ) '-' ( 4 * hexDigit ) '-' ( 12 * hexDigit ) bytes = '0x' { 2 * hexDigit } vstamp = '#' [ 20 * hexDigit ] ':' ( 4 * hexDigit ) number = { digit } digit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' hexDigit = digit | 'A' | 'B' | 'C' | 'D' | 'E' | 'F' text = ? Any number of ASCII characters 32-126 (Printable Group) other than 34 (Double Quote). ? name = ? Any number of ASCII characters 48-57, 65-90, 97-122 (Alpha-numeric), 46 (Dot), 45 (Dash), or 95 (Underscore). ? ws = ? Any number of ASCII characters 9 (Horizontal Tab) or 32 (Space). ? nl = ? Any number of ASCII characters 9 (Horizontal Tab), 10 (Line Feed), 13 (Carriage Return), or 32 (Space). ?