|parsing with user defined operators firstname.lastname@example.org (1999-08-12)|
|Re: parsing with user defined operators email@example.com (Torben Mogensen) (1999-08-13)|
|Re: parsing with user defined operators firstname.lastname@example.org (1999-08-15)|
|Re: parsing with user defined operators Andrew.Walker@nottingham.ac.uk (Dr A. N. Walker) (1999-08-27)|
|Re: parsing with user defined operators email@example.com (rspartan) (1999-08-27)|
|Re: parsing with user defined operators darcy@moa.CS.Berkeley.EDU (1999-08-28)|
|Date:||27 Aug 1999 01:49:47 -0400|
|Organization:||Deja.com - Share what you know. Learn what you don't.|
|References:||99-08-053 99-08-057 99-08-068|
> I'm looking for parsing techniques to handle expressions that include
> user defined operators and overloaded operators. The precedence
> levels of operators are user definable over a range of several hundred
> values. The associativity is user definable as well. Any pointers to
> books or articles are more than welcome.
Do not complicate life yourself !
You don't specify what kind & purpose of language you're designing,
but defining new operators could be both easy/difficult.
My suggestion is to copy the C++ approach :
1. Define several operators.
2. Each one of those operators can be overload
with different type parameters.
3. Cannot change operators associativity or precedence.
Otherwise, you'll make the life difficult for the language designer
(that's YOU) & the language user (the programmer).
In the second approach, You'll need complicated grammar techniques &
the programmer will have problems when trying to write an expression,
and remember each operator precedence.
Just my thoughts, Good Luck.
Return to the
Search the comp.compilers archives again.