On Thu, May 23, 2002 at 11:36:21AM -0400, Ray Denenberg wrote:
> Alan Kent wrote:
>
> > (title=me and) or (title=mine)
> >
> > is a syntax error because "and" is a resrved word.
>
> Why does "and" have to be reserved?
>
> I like the idea of the parenthesis around operands, which would mean
> we don't need quotes around the term, we can embed space in the term,
> and we don't need to reserve operator words.
>
> Is "and" reserved in ccl and is that why you assert that it's
> reserved? If that's the reason then why don't we just ignore that
> rule?
>
> --Ray
(All these little syntax arguments are actually one of the reasons
I like the idea of starting with CCL and deviating only if its not
appropriate - it saves time! :-)
A question back: Who is the target audience of CQL? Most programmers
are familiar with concepts such as reserved words for AND and OR,
and parenthesis to change operator precedence. In most programming
languages, you dont have to put parenthesis around boolean conditions.
Do I have to type in parenthesis even if there is a single condition?
*Most* (not all) grammars go for context free interpretation of tokens
(ie: unquoted 'and' inside or outside parethesis is the same thing).
It makes it easier to use tools like lex and yacc.
So I would say, yes there are lots of options, working out base
guidelines (such as who is the grammar for etc) is important in
order to avoid spending too much time on syntax.
I *personally* like:
* context free tokenization rules
* using similar rules to things that exist where suitable
Alan
--
Alan Kent (mailto:[log in to unmask], http://www.mds.rmit.edu.au/~ajk/)
Project: TeraText Technical Director, InQuirion Pty Ltd (www.inquirion.com)
Postal: Multimedia Database Systems, RMIT, GPO Box 2476V, Melbourne 3001.
Where: RMIT MDS, Bld 91, Level 3, 110 Victoria St, Carlton 3053, VIC Australia.
Phone: +61 3 9925 4114 Reception: +61 3 9925 4099 Fax: +61 3 9925 4098
|