BNF Grammar for Tutorial D Language - Revision 3
================================================
--p
This is a provisional BNF grammar for the new version of the Tutorial D
language. It is based on a draft of 'Databases, Types, and the
Relational Model' by C J Date and H Darwen.
This transcription uses text names for operators in place of these mathematical symbols:
--/p
--##
--tr
--th Text name
--/th
--th Unicode code point
--/th
--tr
--tr
--td SUBSET OF
--/td
--td U+2286
--/td
--/tr
--tr
--td PROPER SUBSET OF
--/td
--td U+2282
--/td
--/tr
--tr
--td SUPERSET OF
--/td
--td U+2287
--/td
--/tr
--tr
--td PROPER SUPERSET OF
--/td
--td U+2283
--/td
--/tr
--tr
--td ELEMENT OF
--/td
--td U+220A
--/td
--/tr
--/table
--p
For details of the Unicode code points, see:
--##
http://www.unicode.org/charts/PDF/U2200.pdf
--## .
The Unicode names for these symbols are different from the names used above.
For example, U+2287 is officially 'SUPERSET OF OR EQUAL TO'.
--/p
--p
The plain text version of this file is available as
--## d3.bnf .
--/p
--hr
--h2 Key D Statements and Fragments
--/h2
--bl
--li Statement
--li Update Operations
--li Substitute Operations
--/bl
--hr
--p
Undefined terms include:
--bl
--li
--li
--li
--li
--li
--li
--li (tentative definition provided)
--li (tentative definition provided)
--/bl
--hr
--p
Unreferenced terms include:
--bl
--li
--li - which contains the only reference to
--li - which contains the only reference to
--li - which contains the only reference to
--li
--/bl
--hr
::= CONSTRAINT
::= '(' [ ',' ] [ ',' ] ')'
::= COUNT | COUNTD | SUM | SUMD | AVG | AVGD | MAX | MIN | AND | OR | XOR | EXACTLY | EXACTLYD | UNION | D_UNION | INTERSECT
::= VAR
::=
::= COUNT '(' ')'
::=
::= VAR ARRAY
::=
|
|
::=
::=
::= FROM
::=
::= |
::=
IS_ '(' ')'
| IS_SAME_TYPE_AS '(' ',' ')'
::= '(' ')'
::=
TREAT_AS_ '(' ')'
| TREAT_AS_SAME_TYPE_AS '(' ',' ')'
::= BEGIN TRANSACTION
::=
|
|
|
|
|
::=
|
|
|
|
|
|
::= !! Operations such as add, subtract, multiply, divide, concatenate, etc.
::= INTEGER | RATIONAL | CHARACTER | CHAR | BOOLEAN
::=
|
|
|
|
|
|
::= CALL
::= KEY '{' '}'
::= CASE ';' [ ELSE ] END CASE
::= COMMIT
::= COMPOSE
::= BEGIN ';' END
::= CONSTRAINT
::= DROP CONSTRAINT
::= |
::= '='
::=
POSSREP [ ] '{' '}'
::= ASC | DESC
::= DIVIDEBY
::=
[ ':' ]
DO ':=' TO ';'
END DO
::= D_UNION
::= INTERSECT
::= JOIN
::=
|
|
|
|
|
|
|
|
|
::= |
::= JOIN
::= UNION
::=
|
|
::= EXTEND ADD '(' ')'
::= AS
::= ':'
::= GROUP '(' ')'
::= '{' [ ALL BUT ] '}' AS
::= '{' '}'
::= IF THEN [ ELSE ] END IF
::= |
::= LEAVE
::= MINUS
::=
|
::=
|
::=
|
|
|
|
|
|
|
|
|
|
::=
|
|
|
|
|
::=
IS '{' '}'
::= D_UNION [ ] '{' '}'
::= INTERSECT [ ] '{' '}'
::= JOIN '{' '}'
::=
|
|
|
::=
::= JOIN '{' '}'
::= UNION [ ] '{' '}'
::= AS
::= !! ... an empty string