Does Syntax.rules.txt contain all rules?
First of all, @ronsavage and @jleffler thank you so much for sharing these resources.
I'm currently working through the newest SQL 2023 BNF:
- https://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_IEC_9075-1_2023_ed_6_-id_76583_Publication_PDF(en).zip
- https://standards.iso.org/iso-iec/9075/-2/ed-6/en/
From the generated Syntax.rules.txt I was only able to find three rules, I'm not sure if I'm not understanding the document or if in fact it is incomplete?
The following is a list of all the !! See the Syntax Rules. rules I've found in the new BNF. I've marked the ones that I could find in Syntax.rules.txt
- [x]
<space> - [x]
<identifier start> - [x]
<identifier extend> - [ ]
<Unicode escape character>https://en.m.wikipedia.org/wiki/Escape_character - [ ]
<non-double quote character>(this would be any character that does not match<double quote>) - [ ]
<whitespace>https://en.m.wikipedia.org/wiki/Whitespace_character - [ ]
<truncating whitespace>https://en.m.wikipedia.org/wiki/Whitespace_character (this rule is never used in the BNF) - [ ]
<bracketed comment contents> - [ ]
<newline>https://en.m.wikipedia.org/wiki/Whitespace_character - [ ]
<non-quote character>(this would be any character that does not match<quote>) - [ ]
<non-escaped character>(this would be any character that does not match<escaped character>) - [ ]
<escaped character>https://en.m.wikipedia.org/wiki/Escape_character - [ ]
<JSON path literal> - [ ]
<JSON path string literal> - [ ]
<JSON path numeric literal> - [ ]
<JSON path identifier> - [ ]
<JSON path key name> - [ ]
<implementation-defined JSON representation option>(not in the rules, similiar to<preparable implementation-defined statement>) - [x]
<preparable implementation-defined statement> - [x]
<SQLSTATE class code>(in the rules the name is<SQLSTATE class value>) - [x]
<SQLSTATE subclass code>(in the rules the name is<SQLSTATE subclass value>) - [x]
<host label identifier> - [x]
<host PL/I label variable> - [x]
<embedded SQL Ada program> - [ ]
<Ada host identifier> - [x]
<embedded SQL C program> - [ ]
<C host identifier> - [x]
<embedded SQL COBOL program> - [ ]
<COBOL host identifier> - [x]
<embedded SQL Fortran program> - [ ]
<Fortran host identifier> - [x]
<embedded SQL MUMPS program> - [ ]
<MUMPS host identifier> - [x]
<embedded SQL Pascal program> - [ ]
<Pascal host identifier> - [x]
<embedded SQL PL/I program> - [ ]
<PL/I host identifier> - [ ]
<direct implementation-defined statement>(not in the rules, similiar to<preparable implementation-defined statement>)
Hi Benjamin
I have not sighted these documents before. As it says on my website at http://savage.net.au/SQL.html, the files I host were generated by someone else, Domingo Alvarez Duarte. This appears to be his github repo: https://github.com/mingodad. Perhaps you could email him directly?
No-one has explained to me how the official docs are converted into the files I host.
You mention Syntax.rules.txt. I cannot see how to generate this file, so I don't think I can help much, especially as you have (presumably) already generated it.
I shall forward your email to Nigel Horne, who originally asked me to host the files. Perhaps he can help. I'm in Melbourne Australia and he I think lives in England. So there will probably be a time delay before he can respond, but I'll keep you informed.
-- Cheers Ron Savage savage.net.au quantumiq.au symboliciq.au
Hi Benjamin
I have not sighted these documents before. As it says on my website at http://savage.net.au/SQL.html, the files I host were generated by someone else, Domingo Alvarez Duarte. This appears to be his github repo: https://github.com/mingodad. Perhaps you could email him directly?
No-one has explained to me how the official docs are converted into the files I host.
You mention Syntax.rules.txt. I cannot see how to generate this file, so I don't think I can help much, especially as you have (presumably) already generated it.
I shall forward your email to Nigel Horne, who originally asked me to host the files. Perhaps he can help. I'm in Melbourne Australia and he I think lives in England. So there will probably be a time delay before he can respond, but I'll keep you informed. …
All good, I checked of some others that I found in the file https://github.com/ronsavage/SQL/blob/master/Syntax.rules.txt
But still looks like there is some missing rules, unless I just don’t know how to read, which there is a high likelihood of 😂
Hi Benjamin
Nigel answered already. He can help but both he and I are confused as to exactly what you need done. Can you expand on this?
-- Cheers Ron Savage savage.net.au quantumiq.au symboliciq.au
Hi Benjamin
Nigel answered already. He can help but both he and I are confused as to exactly what you need done. Can you expand on this? …
I would like to know what the rules are for which are not in the current file, e.g non-double quote character, whitespace and non-escaped character.
Here is a list of the rules I could find in the file, although there is still quite a few missing: https://github.com/ronsavage/SQL/issues/29#issue-2918287149
Hi Benjamin
I feel sure the missing ones are defined in other standards documents.
If you check Section 2 ('Normative References') of the PDF you sent me, it lists all the other reference docs required to understand the things not defined in the PDF.
An overview is at: https://www.iec.ch/understanding-standards
For instance, the 1st one, ISO/IEC 646:1991[Current] Information technology - ISO 7-bit coded character set for information interchange, is available here: for $AUD184 (Australian Dollars) : https://store.standards.org.au/product/iso-iec-646-1991 and here: for $CFH98 (Swiss Francs): https://www.iso.org/standard/4777.html
But I would be reluctant to pay for any of these...
I would like to know what the rules are for which are not in the current file, e.g non-double quote character, whitespace and non-escaped character.
-- Cheers Ron Savage savage.net.au quantumiq.au symboliciq.au
Hi Benjamin
I feel sure the missing ones are defined in other standards documents.
If you check Section 2 ('Normative References') of the PDF you sent me, it lists all the other reference docs required to understand the things not defined in the PDF.
An overview is at: https://www.iec.ch/understanding-standards
For instance, the 1st one, ISO/IEC 646:1991[Current] Information technology - ISO 7-bit coded character set for information interchange, is available here: for $AUD184 (Australian Dollars) : https://store.standards.org.au/product/iso-iec-646-1991 and here: for $CFH98 (Swiss Francs): https://www.iso.org/standard/4777.html
But I would be reluctant to pay for any of these... …
I see, for my needs I can properly assume a lot of them. e.g whitespace, newline and etc. And the rest I will ignore. If I ever come by those other standards, I’ll create a PR to update the file with the missing rules.
On 2025-03-14 05:00, Benjamin Schultzer wrote:
I see, for my needs I can properly assume a lot of them. e.g whitespace, newline and etc. And the rest I will ignore. If I ever come by those other standards, I’ll create a PR to update the file with the missing rules.
Excellent. That has all the makings of a PLAN!
Cheers Ron Savage savage.net.au quantumiq.au symboliciq.au