Csound Csound-dev Csound-tekno Search About

[Csnd] csoundParseOrc - detect if the code is valid

Date2013-07-24 01:39
FromTarmo Johannes
Subject[Csnd] csoundParseOrc - detect if the code is valid

Hi,

 

I want to test, if some text is valid csound code before I compile it with csoundCompileOrc ,

 

how can I determin it by reading the struct TREE that the code is valid or there is some errors? or what would be preferred way to do it?

 

From Csound API documentation I read just:

 

PUBLIC TREE

csoundParseOrc (CSOUND *csound, const char *str)

 

what the fields of TREE mean, remains unclear to me.

 

thanks,

tarmo

 


Date2013-07-24 11:45
FromSteven Yi
SubjectRe: [Csnd] csoundParseOrc - detect if the code is valid
Hi Tarmo,

If you use csoundParseOrc now with bad orc code, I would expect it return a NULL.  Have you tried that and gotten that result? 

steven


On Tue, Jul 23, 2013 at 8:39 PM, Tarmo Johannes <tarmo.johannes@otsakool.edu.ee> wrote:

Hi,

 

I want to test, if some text is valid csound code before I compile it with csoundCompileOrc ,

 

how can I determin it by reading the struct TREE that the code is valid or there is some errors? or what would be preferred way to do it?

 

From Csound API documentation I read just:

 

PUBLIC TREE

csoundParseOrc (CSOUND *csound, const char *str)

 

what the fields of TREE mean, remains unclear to me.

 

thanks,

tarmo

 



Date2013-07-24 16:52
FromTarmo Johannes
SubjectRe: [Csnd] csoundParseOrc - detect if the code is valid

Thank you!

 

Yes, that was it. Works and was exactly what I needed.

 

best!

tarmo

 

On Wednesday 24 July 2013 06:45:45 Steven Yi wrote:

Hi Tarmo,


If you use csoundParseOrc now with bad orc code, I would expect it return a NULL.  Have you tried that and gotten that result? 


steven



On Tue, Jul 23, 2013 at 8:39 PM, Tarmo Johannes <tarmo.johannes@otsakool.edu.ee> wrote:

Hi,

 

I want to test, if some text is valid csound code before I compile it with csoundCompileOrc ,

 

how can I determin it by reading the struct TREE that the code is valid or there is some errors? or what would be preferred way to do it?

 

From Csound API documentation I read just:

 

PUBLIC TREE

csoundParseOrc (CSOUND *csound, const char *str)

 

what the fields of TREE mean, remains unclear to me.

 

thanks,

tarmo