expression-evaluation

Left to right expression evaluation

In C# is it guaranteed that expressions are evaluated left to right? For example: myClass = GetClass(); if (myClass == null || myClass.Property > 0) continue; Are there any languages that do not comply? ...

AND/OR chains in C

I'm pretty much positive about this, but just to be on the safe side: Does the C standard guarantee that AND chains (A && B && ...) will be evaluated left to right, and that evaluation will stop as soon as there's a 0? Same question for OR. (As soon as there's a 1) Can I count on this for other C-style languages? Is this code safe: ...

Evaluate dice rolling notation strings

Rules Write a function that accepts string as a parameter, returning evaluated value of expression in dice notation, including addition and multiplication. To clear the things up, here comes EBNF definition of legal expressions: roll ::= [positive number], "d", positive number entity ::= roll | positive number expression ::= entity {...

Need guidance towards evaluative boolean logic tree

I can't seem to find a pointer in the right direction, I am not even sure what the terms are that I should be researching but countless hours of googling seem to be spinning me in circles, so hopefully the collective hive of intelligence of Stack Overflow can help. The problem is this, I need a way to filter data in what I can only call...

Is IronRuby ScriptSource.Execute thread safe?

We are implemented expression evaluator via hosting IronRuby engine. Simplified version of evaluator you can see here. Now we are trying to get more performance from IronRuby via executing expressions in many threads (and we got it). One question bothers us - is Execute method thread safe? ...

How can I evaluate a math expression represented by a string?

It's easy to implement a "Calculator" to parse a string (e.g., 2 ^ 3 / 2) and compute the result of operations. But, is there a library already capable of doing this? ...

Why would prefix increment/decriment operator be evaluated before postfix even though former has lower precedence?

From what I have read it seems postfix increment and decrement operators have higher precedence over prefixed ones, but in an expression where both are being used the prefix gets evaluated first. I am reading from SCJP A comprehensive Khalid. Any recommendation on resources for clearly understanding operators and assignment in java would...