From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ee0dc912649d50d4 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed-00.mathworks.com!prodigy.com!news-FFM2.ecrc.net!informatik.uni-bremen.de!cs.tu-berlin.de!uni-duisburg.de!not-for-mail From: Georg Bauhaus Newsgroups: comp.lang.ada Subject: Re: Ada DB bindings and APQ Date: Wed, 15 Dec 2004 15:01:07 +0000 (UTC) Organization: GMUGHDU Message-ID: References: <1km3c584awura$.y7djkir1ozya$.dlg@40tude.net> <17Ovd.52$Wt5.33108@read2.cgocable.net> NNTP-Posting-Host: l1-hrz.uni-duisburg.de X-Trace: a1-hrz.uni-duisburg.de 1103122867 13117 134.91.1.34 (15 Dec 2004 15:01:07 GMT) X-Complaints-To: usenet@news.uni-duisburg.de NNTP-Posting-Date: Wed, 15 Dec 2004 15:01:07 +0000 (UTC) User-Agent: tin/1.5.8-20010221 ("Blue Water") (UNIX) (HP-UX/B.11.00 (9000/800)) Xref: g2news1.google.com comp.lang.ada:6968 Date: 2004-12-15T15:01:07+00:00 List-Id: Warren W. Gay VE3WWG wrote: : Brian May wrote: :> Example 26-3. Connect to SQLite on a Unix machine using options :> :> sqlite:////full/unix/path/to/file.db?mode=0666 : : Not sure why there are so many leading slashes in this case. I think its because the database name is actually a file name? The example having 'hostspec:110//usr/db_file.db' may be similar. Not sure either. I've started writing a grammer, here is the part for the first variant of the syntax. (It may have missed the '//', and others of course.-) Comments most welcome. The start rule is named DSN. Char -> mostly UTF-8 alphanumeric, in particular not on of []{}(),;?*=!@ (as per Microsoft, but what to do withouth [] on VMS or Toronto file system?) (Char needs to be escaped in places. This is where the parser might become tricky. But we can count brackets, and count implicitly (e.g., ':', '/').) MSExcl -> '[' | ']' | '{' | '}' | '(' | ')' MSExcl -> ',' | ';' | '?' | '*' | '=' | '!' | '@' PWChar -> what characters are allowed in DBes? Can they include MSExcl DBSpeak -> 'odbc', 'mysql', ... DB -> 'mysql', 'psql', 'db2', 'sybase', 'solid', ... (Note the ovelap of DBSpeak and DB) Protocol -> 'tcp', 'p9', ... Protocol_Opts -> TCP_Opts | P9_Opts | ... (foreach in Protocol) Host -> Hostname Opt_Port Opt_Port -> ':' Port Hostname -> IP | FQN Port -> DIGIT DIGIT* (how many digits max?) IP -> an IP number, V4 or V6 FQN -> fully qualified host name DBName -> Char Char* (is this DB specific?) UName -> Char Char* (is this restrictive? ':' in UName complicates. Are there DB systems allowing ':' in UName?) PWord -> PWChar PWChar* TCP_Opts -> Host QSOptions -> '?' a query string as per CGI, for additional DB specific options (note that '?' is excluded from Char) The two Variants could either be treated separately, or we could remember whether the variant syntax was used, and then swith later. But the variant syntax seems to be simpler than the "standard" one, in particular I see not QSOptions. So just decide right at the beginning by the presence of '('...')' and reuse components not at the grammar level, but at implementation leven (if needed). *** S T A R T H E R E *** *** Standard *** DSN -> DB First_Colon First_Colon -> ':' '//' '/' DBName_Tail First_Colon -> ':' '//' Server '/' DBName_Tail First_Colon -> ':' '//' U '/' DBName_Tail (There is overlap in Server and U, but as a minimum, we can look ahead for required '@', implying U) U -> UName Opt_PW '@' Server Opt_PW -> ':' PWord Server -> Host Server -> Protocol '+' Host (again, look ahead for '+' before EOS or '/' or '?'. Can there be QSOptions without a preceding DBName? Check this anyway, a '+' in a QSOptions is not likely the right one) (hostnames may be named using names from DB!) DBName_Tail -> '/' DBName QSOptions *** O R S T A R T H E R E *** *** Variant syntax *** DSN -> DBSpeak '(' DB ')' ...