Hi! I'm writing a java library for programatically building circuits of sound processing units. It's mainly a wrapper to csound. From the circuit a csound orc is generated. Each unit correspond to a csound opcode and has ports corresponding to the opcode parameters/outputs. I'm allowing the construction of units from csound expressions too. A unit of this kind has input ports for the variables in the expression and one output port. I need to parse and validate the expression. I have metadata in XML describing csound opcodes already, which I use to create the opcode units. This metadata indicates number of params, their rates, etc. But I'm not sure if I can treat opcodes and operators (the ones with functional syntaxis, as sin) the same and use this metadata for both validation of circuits and expressions. Below are two detailed questions to which I couldn't find a definite answer. Please I need your help. Thank you in advance. Regards, Carlos. 1) From "The Canonical Csound Reference Manual": """ Thoughout this manual, the term "opcode" is used to indicate a command that usually produces an a-, k-, or i-rate output, and always forms the basis of a complete Csound orchestra statement. Items such as "+" or "sin(x)" or, "( a >= b ? c : d)" are called "operators." """ Leaving aside unary and binary operators +,-,*,... , to which extent are opcodes and operators interchangeable?: a) Can I use opcodes with one output value in expressions? (for example ar=foscil(xamp,....) ) b) Can I use the opcode syntax for operators? (for example ao sin ai) c) What is the reason to distinguish between them? 2) Is the following grammar adequate for csound expressions? Expr := Expr LogOp Clause | Clause LogOp := '&&' | '||' Clause := Clause TermOp Term | Term TermOp := '+' | '-' Term := Term FactOp Factor | Factor FactOp := '*' | '/' | '%' Factor := '(' Expr ')' | ( '+' | '-' ) Expr | '(' Expr CmpOp Expr '?' Expr ':' Expr ')' | Variable | Function '(' Params ')' CmpOp := '==' | '!=' | '<' | '<=' | '>' | '>=' Variable := an identifier Function := an operator as sin or even an opcode (depending on answer to 1) Params := Params ',' Expr | Expr ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net