[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: CAP ABNF
HI,
I am quit new to this, but something I noticed while
implementing a parser for CAPQL.
Also the ABNF is not inline with the examples and earlier
was said the examples are all valid. See earlier thread
with subject "CAP-QUERY ABNF disagrees with examples"
and line 136 below.
On top of this, I am wondering if an order clause is
useful as part of the capql query part. The order
now depends on the columns given in the 'SELECT' part
'cap-val', but it is sometimes usefull to be more specific.
On Sunday, June 15, 2003, at 01:38 AM, Doug Royer wrote:
I am starting to go through the CAP abnf looking for errors. Below is
the CAP ABNF from CAP draft-10.
66
67 cal-query = "SELECT" SP cap-val SP
68 "FROM" SP comp-name SP
69 "WHERE" SP cap-expr
70
71 / "SELECT" SP cap-cols SP
72 "FROM" SP comp-name
73
74 cap-val = cap-cols / param
75 / ( cap-val "," cap-val )
76
77 ; NOTE: there is NO space around the "," on
78 ; the next line
79 cap-cols = cap-col / ( cap-cols "," cap-col)
80 / "*"
81
82 ; A 'cap-col' is:
83 ;
84 ; Any property name ('cap-prop') found in the
component
85 ; named in the 'comp-name' used in the "FROM"
clause.
86 ;
87 ; SELECT ORGANIZER FROM VEVENT ...
88 ;
89 ; OR
90 ;
91 ; A component name ('comp-name') of an existing
component
92 ; contained inside of the 'comp-name' used in
the "FROM"
93 ; clause.
94 ;
95 ; SELECT VALARM FROM VEVENT ...
96 ;
97 ; OR
98 ;
99 ; A component name ('comp-name') of an existing
100 ; component contained inside of the 'comp-name'
used
101 ; in the "FROM" clause followed by a property
102 ; name ('cap-prop') to be selected from that
component.
103 ; (comp-name "." cap-prop)
104 ;
105 ; SELECT VALARM.TRIGGER FROM VEVENT ...
106
107 cap-col = comp-name
108 / comp-name "." cap-prop
109 / cap-prop
110
111 comp-name = "VEVENT" / "VTODO" / "VJOURNAL" /
"VFREEBUSY"
112 / "VALARM" / "DAYLIGHT" / "STANDARD" / "VAGENDA"
113 / "VCAR" / "VCALSTORE" / "VQUERY" /
"VTIMEZONE"
114 / x-comp / iana-comp
Why is VRIGHT not a component name??
Since the 'comp-name' is not only used in the CAPQL part I believe it
should
be.
On top of that I was wondering if it would not be usefull to seperate
the
CAPQL language (ABNF) more from the rest. Meaning that almost anything
under
'cal-query' have its own rules and those are not used in the other
itmes.
To me it sounds also a bit weird that you could create a query for
selecting
queries. So the "VQUERY" comp-name item looks out of place in that
sense.
115
116 cap-prop = ; A property that may be in the 'cap-comp' named
117 ; in the "SELECT" clause.
118
119 cap-expr = "(" cap-expr ")"
120 / cap-term
121
122 cap-term = cap-expr SP cap-logical SP cap-expr
123 / cap-factor
124
125 cap-logical= "AND" / "OR"
126
127 cap-factor = cap-colval SP cap-oper SP col-value
128 / cap-colval SP "NOT LIKE" SP col-value
129 / cap-colval SP "LIKE" SP col-value
130 / cap-colval SP "IS NULL"
131 / cap-colval SP "IS NOT NULL"
132 / col-value SP "NOT IN" cap-colval"
The above "NOT LIKE", "IS NULL", "IS NOT NULL" and "NOT IN"
all have a single space between the 'words' would it no be usefull
to lower that requirement?? "NOT LIKE" and "NOT LIKE" (2 spaces)
are somehow similar.
Just wondering, since I don't see the need for it.
133 / col-value SP "IN" cap-colval"
134 / "STATE()" "=" ( "BOOKED"
135 / "UNPROCESSED"
136 / "DELETED" )
Are the items BOOKED, UNPROCESSED and DELETED not surrounded with
single quotes (') as defined in the examples??
137
138 cap-colval = cap-col / param
139
140 param = "PARAM(" cap-col "," cap-param ")"
141
142 cap-param = ; Any parameter that may be contained in the
cap-col
143 ; in the supplied PARAM() function
144
145 col-value = col-literal
146 / "SELF()"
147 / "CAL-OWNERS()"
148 / "CAL-OWNERS(" cal-address ")"
149 / "CURRENT-TARGET()"
150
151 cal-address = ; A CALID as define by CAP
152
153 col-literal = "'" literal-data "'"
154
155 literal-data = ; Any data that matches the value type of the
156 ; column that is being compared. That is you
can
157 ; not compare PRIORITY to "some string" because
158 ; PRIORITY has a value type of integer. If it
is
159 ; not preceded by the LIKE element, any '%'
and '_'
160 ; characters in the literal data are not
treated as
161 ; wildcard characters and do not have to be
backslash
162 ; escaped.
163 ;
164 ; OR
165 ;
166 ; If the literal-data is preceded by the LIKE
167 ; element it may also contain the '%' and '_'
168 ; wildcard characters. And if the literal data
169 ; that is comparing contains any '%' or '_'
170 ; characters, they MUST BE backslash escaped as
171 ; described in the notes below in order for
them not
172 ; to be treated as wildcard characters.
173
174 cap-oper = "="
175 / "!="
176 / "<"
177 / ">"
178 / "<="
179 / ">="
180
181
182 SP = ; A single white space ASCII character
183 ; (value in HEX %x20).
Also here, would this be not easier when multiple white space characters
are allowed??
Just wondering.
regards,
Harrie