(* EBNF like grammer notation of VDLt *) (* *) (* Authors: Jens-S. Vöckler *) (* Yong Zhao *) (* *) (* Please note that whitespace are allowed in general between tokens, *) (* except where explicitely stated in the rule "no gaps allowed". This *) (* is to make the grammar more readible. Tokens that are quoted together *) (* must never be separated by gaps, e.g. "${" is one token. *) (* *) (* $Id$ *) (* *) definitions = { definition } ; definition = transformation | derivation ; transformation = "TR" fqdi "(" [ farg-list ] ")" "{" { tr-body } "}" ; derivation = "DV" fqdi "->" tr-map "(" [ aarg-list ] ")" ";" ; fqdi = (* fully qualified domain identifier -- no gaps allowed *) (* namespace::name:version *) identifier "::" identifier ":" version | (* namespace::name *) identifier "::" identifier | (* name:version *) identifier ":" version | (* plain name *) identifier ; tr-map = (* extension to fqdi for version ranges -- no gaps allowed *) (* namespace::name:min,max namespace::name:min, namespace::name:,max *) identifier "::" identifier ":" version-range | (* namespace::name *) identifier "::" identifier | (* name:min,max name:min, name:,max *) identifier ":" version-range | (* plain name *) identifier ; version-range = (* tr-version is versionOf(TR) when match-making *) (* minimum <= tr-version <= maximum *) version "," version | (* minimum <= tr-version *) version "," | (* tr-version <= maximum *) "," version ; farg-list = (* the (optional) formal argument list *) farg-item { "," farg-item } ; farg-item = (* formal argument *) (* following defines a list, omitted type is "none" *) [ filetype ] identifier "[]" [ "=" "[" [ dv-leaf-list ] "]" ] | (* following defines a scalar, omitted type is "none" *) [ filetype ] identifier [ "=" dv-leaf ] ; filetype = (* valid 'type' identifiers *) "none" | (* non-LFN parameters? *) "in" | "input" | (* LFN that are input *) "out" | "output" | (* LFN that are output *) "io" | "inout" (* unspecified LFN use *) ; tr-item = (* transformation body entry *) "argument" [ identifier ] "=" tr-leaves ";" | (* no gaps allowed between identifiers and dot in profile *) "profile" identifier "." identifier "=" tr-leaves ";" ; aarg-list = (* the (optional) actual argument list *) aarg-item { "," aarg-item } ; aarg-item = (* actual argument *) (* "list" definition; allow empty lists, too *) identifier "=" "[" [ dv-leaf-list ] "]" | (* "scalar" definition *) identifier "=" dv-leaf ; tr-leaves = { tr-leaf } ; tr-leaf = text | use ; dv-leaf-list = dv-leaf { "," dv-leaf } ; dv-leaf = text | lfn ; text = '"' qstring '"' ; use = (* no gaps allowed -- except inside rendering texts *) (* ${id} ${in:id} ${":"|id} ${"\"":",":"\""|none:id} *) "${" [ rendering "|" ] [ filetype ":" ] identifier "}" ; rendering = (* rendering a bound variable -- no gaps allowed *) (* "prefix":"separator":suffix *) text ":" text ":" text | (* plain "separator" *) text ; lfn = (* no gaps allowed -- except inside texts *) (* unused version, temporary file hint: @{type:"lfn":"hint"} *) "@{" filetype ":" text ":" text "}" | (* used version, all files are cataloged: @{type:"lfn"} *) "@{" filetype ":" text "}" ; (******************** some lexical stuff *******************) (* Yong, what are the correct charsets? *) identifier = (* the usual stuff -- slightly abbreviated *) (* we may allow a more extended set of permissable chars *) ( "A" .. "Z" | "a" .. "z" | "_" ) { "A" .. "Z" | "a" .. "z" | "0" .. "9" | "_" } ; version = (* basically same as identifier, but may start with digits *) (* we may allow a more extended set of permissable chars *) ( "A" .. "Z" | "a" .. "z" | "0" .. "9" | "_" ) { "A" .. "Z" | "a" .. "z" | "0" .. "9" | "_" | "." } ; qstring = (* any printable char w/ escapes for quote and backslash *) { ?isprint? - ( '"' |'\' ) | '\"' | '\\' } ;