oct2mat script based on parse tree
Muthiah Annamalai
muthuspost at gmail.com
Wed Jan 9 23:59:50 CST 2008
Muthiah Annamalai wrote:
>
>> 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.
> I can confirm the patch works as expected. The clock-skew
> was the culprit.
> -Muthu
>
I have attached patches to the tree_print_code class that converts it
to a also do the job of converting to matlab code.
It changes the constructor, and uses 4 static functions to get the job done.
Please review the patch, and suggest improvements.
I am not attaching a changelog yet.
-Muthu
-------------- next part --------------
A non-text attachment was scrubbed...
Name: o2m.diff
Type: text/x-patch
Size: 13119 bytes
Desc: not available
Url : https://www.cae.wisc.edu/pipermail/octave-maintainers/attachments/20080109/8f4191fc/attachment.bin
More information about the Octave-maintainers
mailing list