[Prev][Next][Index][Thread]

Re: Progress on Parsing



> Treating + and - as n-ary rather than binary operators is an
> interesting idea, but can perhaps be handled via the code that
> exports the expressions to say Mathematica or Maple.

It could be done that way.  Certainly the decision as to how they
are represented is an internal one unless precedence files, which are
public (I think), force them to (unnaturally) be left or right associative
as in your example.

I think that you will find, as you progress in your implementation, that
treating them as binary operators is a bad idea.  Functionality that
is depth-related, such as line breaking, will be significantly more
complicated.  My guess is that most applications will want to treat
them as nary operators.  Perhaps Raman can comment on whether this is
true for speech.

I should also note that computer algebra systems treat '+' and '-' as
equals.  I.e., "a+b-c" are all at the same level.  The same is true for
inequalities such as "a < b <= c".  Again, doing differntly will make
depth-related functionality much harder to implement.

	Neil