Skip to content

Does Syntax.rules.txt contain all rules? #29

Open

Description

@Schultzer

First of all, @ronsavage and @jleffler thank you so much for sharing these resources.

I'm currently working through the newest SQL 2023 BNF:

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

  • <space>
  • <identifier start>
  • <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>)
  • <preparable implementation-defined statement>
  • <SQLSTATE class code> (in the rules the name is <SQLSTATE class value>)
  • <SQLSTATE subclass code> (in the rules the name is <SQLSTATE subclass value>)
  • <host label identifier>
  • <host PL/I label variable>
  • <embedded SQL Ada program>
  • <Ada host identifier>
  • <embedded SQL C program>
  • <C host identifier>
  • <embedded SQL COBOL program>
  • <COBOL host identifier>
  • <embedded SQL Fortran program>
  • <Fortran host identifier>
  • <embedded SQL MUMPS program>
  • <MUMPS host identifier>
  • <embedded SQL Pascal program>
  • <Pascal host identifier>
  • <embedded SQL PL/I program>
  • <PL/I host identifier>
  • <direct implementation-defined statement> (not in the rules, similiar to<preparable implementation-defined statement>)

Activity

  1. ronsavage commented on Mar 13, 2025

    @ronsavage
    Owner
  2. Schultzer commented on Mar 14, 2025

    @Schultzer
    Author

    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 😂

  3. ronsavage commented on Mar 14, 2025

    @ronsavage
    Owner
  4. Schultzer commented on Mar 14, 2025

    @Schultzer
    Author

    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: #29 (comment)

  5. ronsavage commented on Mar 14, 2025

    @ronsavage
    Owner
  6. Schultzer commented on Mar 14, 2025

    @Schultzer
    Author

    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.

  7. ronsavage commented on Mar 14, 2025

    @ronsavage
    Owner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      ⌂ Proxy