# This file is used by parser to provide hint about statement syntax.
#
# TODO: This file will eventually be generated from a single source.
#
# Each help topic consists of a number lines enclosed by a starting
# and closing lines of this syntax: 
#
#  $+$ name
#  ...
#  $-$ name
#
# The notation is in BNF; keywords are quoted in double-quotes.
# An extension to BNF is the (),+ and (),*, which means 0/one or
# more elements separated by commas.
# Commend can follow "--" at the end of the line.
#

$+$ mail::send
"mail::send" [ CharSet ] [ "{" ( HeaderName "=" Value ),+ "}" ]
  ( "from"     [ CharSet ] ":" EmailAddress
  | "to"       [ CharSet ] ":" EmailAddresses
  | "cc"       [ CharSet ] ":" EmailAddresses
  | "bcc"      [ CharSet ] ":" EmailAddresses
  | "subject"  [ CharSet ] ":" Text
  | "body"     [ CharSet ] ":" Text
  | "htmlBody" [ CharSet ] ":" Text
  | "attach" ":" Attachments
  )+
  [ Block ]
  "use" ServerName [ "," Username [ "," Password ] ]
  ";"
-- All the values can be expressions evaluated to string values.
-- 'CharSet' can be the character-set name or "charset=CharacterSetName".
-- 'HeaderName' are used as email message headers.
-- 'EmailAddress' is a string like "Jon Doe <jdoe@some.org>" or "jdoe@some.org".
-- 'EmailAddresses' is a string with multiple EmailAddress's, separated by ",".
-- 'Attachments' is a string with multiple attachments separated by ",";
--     each attachment can be "some/file.ext" or "aFileName <some/file.ext>".
-- 'EmailAddresses' and 'Attachments' can also be arrays.
-- 'Block' is an arbitrary code block where $_ is the current Email object.
$-$ mail::send


$+$ db::connect
"db::connect" [ ConnectName ]
  [ "(" ( AttributeName "=" Value ),* ")" )* "to" ]
  JDBD_URL [ "," Username [ "," Password ] ] ";"
-- 'ConnectName' is the variable name to hold this connection object.
--     If omitted, by default it is "$$con".
-- 'AttributeName' can be "driver", "autoCommit", "readOnly", "catalog",
--     "typeMap", and "transactionIsolation".
-- Attribute "transactionIsolation" can take these values:
--    "transaction_none", "transaction_read_committed",
--    "transaction_read_uncommitted" and "transaction_serializable".
$-$ db::connect


$+$ exec
"exec" ( "/" ExecSwitch )* [ "<" ReturnValue ">" ]
  CommandLine
  [ "from" StartDirectory ]
  [ "with" [ "<" "new" ">" ] ( EnvVar "=" Value ),* ]
  [ "input" Block ]
  [ "output" Block ]
-- 'ExecSwitch' can be "needSystemIn", "asis" and "bg" or "background".
-- 'CommandLine' supports piping and redirecting.
-- If 'ReturnValue' is specified, the "/bg" switch is ignored and always
--    run synchronously, and return the exit value in the variable.
-- The program is started in 'StartDirectory', when specified, or the
--    current directory set by the "cd" command.
-- Environment variables of the current process are inherited by the
--    new process, unless "with <new>" is specifed. In any case, the
--    'EnvVar' values can be set.
-- The "input" block is used to read in the executable's stdout.
--    The "output" block is used to feed into the executable's stdin.
--    Both "input" and "output" blocks can be specified at the same time.
$-$ exec
