Boost logo

Boost :

From: joel de guzman (isis-tech_at_[hidden])
Date: 2001-06-01 12:10:04


From: "Larry Evans" :

Hello Larry,
>
> Yet One more possibility. Postfix -- and ++ to mean BNF postfix * and +.
>
> Also, if * means sequence, why not make + mean alternative?
> I know that's an awful lot of +'s. But then why not & and | to mean BNF
> sequence and alternative. I know you responded before about using & for
this, but
> your objection had something to do with convention meaning for
> the operators was violated. But certainly the above use of * does not
reflect conventional
> meaning. Or maybe I misunderstood your previous objection to using &.
>

I objected simply because & is already used in Spirit to mean
set intersection. Spirit has all the set operators. This I believe
is one of its strengths. We have:

a | b Union (match a or b. Also referred to as alternatives)
a & b Intersection (match a and b)
a - b Difference (match a but not b)
a ^ b XOR (match a or b, but not both)

Set union is the most used. Followed by set difference.
Set intersection is unique and interesting because it has the
property that it could define a language that is not context free.

I quote the Sprit doc:

<quote>
Some researchers assert that the intersections let us define
languages that are not context free. "The theory of defining
a language as the intersection of a finite number of context free
languages was developed by Leu and Weiner in 1973".
</quote>

Also see XBNF (extreme BNF) by Dr. Dick Botting:
www.csci.csusb.edu/dick/maths/intro_ebnf.html

Set Xor is there for orthogonality. But is also
very interesting. I would like to do more research
on its properties. What piqued my curiosity on XOR
is that it is used in many things related to chaos (pseudo
random number generators, genetic algorithms, encryption,
hash functions, etc.) I have this gut feeling there's something
very interesting hidden in XOR for use in parsing.

match a or b, but not both... Yet unexplored world.
........

I hope I made myself clear.

Thanks,
Joel de Guzman

PS> I remember someone suggested &&, yet should we also
use ||.. And then it gets quite messy.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk