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: Muthiah Annamalai
Subject: Re: oct2mat script based on parse tree
Date: Wed, 09 Jan 2008 00:29:45 -0600
User-agent: Thunderbird 2.0.0.6 (X11/20071022)

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.

Since Octave is a moving target (which is nice actually!) we have some
issues,like I didnt have boolean expressions involving strings folded over. Now all the bad ways of handling this can be avoided if we can introduce a variable for handlingthe folding of code conditionally.

Like I would want to call

folding_option = false;
retval = octave_parse( folding_option );

Or, one way I could think of it, is to use the parser again, to
parse the 'print_original_text' function. This is a little bit of
a hassle but well avoids a global delta fractions of a second, which
means we maynot need the previous route.

-Muthu




reply via email to

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