oct2mat script based on parse tree

Muthiah Annamalai muthuspost at gmail.com
Wed Jan 9 16:37:57 CST 2008


John W. Eaton wrote:
> On  9-Jan-2008, Muthiah Annamalai wrote:
>
> | John W. Eaton wrote:
> | > On  9-Jan-2008, Muthiah Annamalai wrote:
> | >
> | > | we have some
> | > | issues,like I didnt have boolean expressions involving strings folded 
> | > | over.
> | >
> | > I don't understand what you mean by that.
> | >
> | > jwe
> | >   
> | This is the boolean exp -> const , folding I was talking about.
>
> OK.  I suppose it would be useful to have an option to turn off any
> optimizations that happen in the parser.  It should be easy to do, and
> I see that as independent of your tree walking code.
>
> jwe
>
>   
I have attached a patch to allow conditional tree folding.
It works using the global variable

bool parser_folding_and_optimization_flag;

which user must push onto unwind stack, and use
the accessor functions

parser_enable/disable_optimization()

and query by

parser_require_optimization()

I have one problem however, the various symbols are not exported,
and I think it maybe due to a clock-skew in my box, which I cannot fix.
So I hope this patch is correct. Waiting for my build to complete.
The changes are correct syntactic/semantically however.

Patch follows. Changelog is

2008-01-09 Muthiah Annamalai <muthuspost at gmail.com>

* parse.h (parser_enable_optimization, parser_disable_optimization,
parser_require_optimization,parser_folding_and_optimization_flag):
New function, boolean flag declaration.
* parse.y (parser_enable_optimization, parser_disable_optimization,
parser_require_optimization,parser_folding_and_optimization_flag):
New boolean flag and functions to make conditional fold()-ing.


-Muthu

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: clog
Url: https://www.cae.wisc.edu/pipermail/octave-maintainers/attachments/20080109/7b6fc684/attachment-0002.ksh 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: op
Url: https://www.cae.wisc.edu/pipermail/octave-maintainers/attachments/20080109/7b6fc684/attachment-0003.ksh 


More information about the Octave-maintainers mailing list