Hi All, Just another update with the new parser. I got to a point a couple days ago to be able to compile a simple expression (a single expression of +, -, /, or *), just to get the basic compilation down. This is currently being done when an opcode is being compiled from it's AST representation, so when a node is found that is an expression it goes and builds opcodes from those expression nodes and prepends that to the opcode being written. (For those that haven't looked at that bit of code, expressions get compiled down as a number of opcode calls that happen before the opcode that contains the expression, with the expression replaced with a temp variable). So, I got to the point where the simple expression works and was going to move on to implementing the rest of the expression compiling (the other operators and multiple expression statements) but thought that this stuff shouldn't be done this way, but rather in an pass over the AST before it gets to the compilation pass. Then for each instruments, all expressions would have been expanded out to opcode calls, making the compilation a little more straightforward I think. I am thinking now the stage should be something like "csound_orc_expand_expressions" and it would happen before optimization. The optimization pass would take care of constant folding (I don't think the current parser does this, so this might be a possible area where we'll see a little speedup), minimizing number of temp variables (like doing the same optimization check that current parser has with not using a temp if the expression is only going to be assigned to a var and instead use the var as the output to the opcode call at the end of the expression chain), dead code elimination, etc. So that'd take us to four passes: parse expand_expressions optimize compile If anyone has any thoughts on this I'd love to hear them as I'm still learning a great deal myself as I'm going along. Thanks! steven ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net