|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. --> |
|
3 <!-- This component and the accompanying materials are made available under the terms of the License |
|
4 "Eclipse Public License v1.0" which accompanies this distribution, |
|
5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". --> |
|
6 <!-- Initial Contributors: |
|
7 Nokia Corporation - initial contribution. |
|
8 Contributors: |
|
9 --> |
|
10 <!DOCTYPE concept |
|
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
|
12 <concept id="GUID-6FA036F6-F4C7-50CA-B08F-7D5F8B7FB6B5" xml:lang="en"><title>BNF |
|
13 Grammars</title><shortdesc>Backus-Naur Form (BNF) grammars are used as a tool for describing |
|
14 language and command syntax, for example: </shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
15 <p> <codeph>select-statement</codeph> : <codeph>SELECT</codeph> <codeph>select-list</codeph> <codeph>FROM</codeph> <codeph>table-name</codeph> [ <codeph>restriction</codeph> ] [ <codeph>ordering</codeph> ] </p> |
|
16 <p> <codeph>restriction</codeph> : <codeph>WHERE</codeph> <codeph>search-condition</codeph> </p> |
|
17 <p> <codeph>ordering</codeph> : <codeph>ORDER BY</codeph> <codeph>sort-order</codeph> </p> |
|
18 <p>A BNF definition states that the named item given before the colon is written |
|
19 as described after the colon. For example, an <i>ordering</i> is written as <codeph>ORDER |
|
20 BY</codeph> followed by a <i>sort-order</i> (which may be defined elsewhere). </p> |
|
21 <table id="GUID-AB7C2618-FF3B-5F2A-9EEB-05930D804CA0"> |
|
22 <tgroup cols="2"><colspec colname="col0"/><colspec colname="col1"/> |
|
23 <tbody> |
|
24 <row> |
|
25 <entry><p> <b>BNF expression</b> </p> </entry> |
|
26 <entry><p> <b>What it means</b> </p> </entry> |
|
27 </row> |
|
28 <row> |
|
29 <entry><p> <codeph>named-construction</codeph> : <codeph>expression</codeph> </p> </entry> |
|
30 <entry><p>Declares that a <i>named-construction</i> is written as <i>expression</i>. </p> </entry> |
|
31 </row> |
|
32 <row> |
|
33 <entry><p> <codeph>named-construction</codeph> : <codeph>expression1</codeph> <codeph>expression2</codeph> </p> </entry> |
|
34 <entry><p>Declares that a named-construction is written as either <i>expression1</i> or <i>expression2</i>. </p> </entry> |
|
35 </row> |
|
36 <row> |
|
37 <entry><p> <codeph>word</codeph> </p> </entry> |
|
38 <entry><p>The word <codeph>word</codeph>, written literally. </p> </entry> |
|
39 </row> |
|
40 <row> |
|
41 <entry><p> <codeph>exp1</codeph> <codeph>exp2</codeph> </p> </entry> |
|
42 <entry><p> <i>exp1</i> followed by <i>exp2</i>. </p> </entry> |
|
43 </row> |
|
44 <row> |
|
45 <entry><p> <codeph>[exp]</codeph> </p> </entry> |
|
46 <entry><p> <i>exp</i> is optional. </p> </entry> |
|
47 </row> |
|
48 <row> |
|
49 <entry><p> <codeph>[ exp1 | exp2 ]</codeph> </p> </entry> |
|
50 <entry><p>Either <i>exp1</i> or <i>exp2</i> or nothing. </p> </entry> |
|
51 </row> |
|
52 <row> |
|
53 <entry><p> <codeph><exp></codeph> </p> </entry> |
|
54 <entry><p> <i>exp</i> is an entity or name that you specify. </p> </entry> |
|
55 </row> |
|
56 <row> |
|
57 <entry><p> <codeph>exp</codeph> + </p> </entry> |
|
58 <entry><p> <i>expression</i>, repeated one or more times. </p> </entry> |
|
59 </row> |
|
60 <row> |
|
61 <entry><p> <codeph>exp</codeph> * </p> </entry> |
|
62 <entry><p> <i>expression</i>, repeated zero, one or more times. </p> </entry> |
|
63 </row> |
|
64 </tbody> |
|
65 </tgroup> |
|
66 </table></conbody></concept> |