octave-maintainers
[Top][All Lists]
Advanced

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

Re: oct2mat script based on parse tree


From: John W. Eaton
Subject: Re: oct2mat script based on parse tree
Date: Wed, 09 Jan 2008 13:59:17 -0500

On  9-Jan-2008, Muthiah Annamalai wrote:

| John W. Eaton wrote:
| > On  8-Jan-2008, I wrote:
| >
| > | I don't think you need to modify the parse tree here when you
| > | encounter something like "+=".  You just need to emit the lhs, then
| > | the binary op corresponding to the OP= operator (you can get that with
| > | the octave_value::op_eq_to_binary_op method) and then emit the rhs.
| >
| > Oops, I meant to say
| >
| >   emit lhs
| >   emit "="
| >   emit lhs again
| >   emit binary operator corresponding to original OP= operator
| >   emit rhs
| >
| > jwe
| >
| >   
| But I think to make this possible we must have a method by which
| we can turn off the fold()-ing of the parse tree, which happens
| automatically
| right now.

I don't understand why that would be necessary.  As far as I can tell,
the constant folding code would only affect the RHS of the expression,
or possibly indices of the LHS expression.  What case are you thinking
of where it would cause trouble?

| Since Octave is a moving target (which is nice actually!)

Since it is a moving target, your code is more likely to remain
synchronized with the sources if you help to integrate the changes now
(by making them conditional modifications of the existing
tree_print_code class and submitting patches) rather than working on
your own completely separate project and waiting until later to merge
a larger set of changes all at once.

| we have some
| issues,like I didnt have boolean expressions involving strings folded 
| over.

I don't understand what you mean by that.

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]