John K
John K

Reputation: 28869

Built-in precedence for Expression Trees?

I'm unable to find the .NET FCL built-in concept of precedence to leverage while constructing Expression Trees. Ref System.Linq.Expressions Namespace. Is this something that must be handled manually in code, or is it somehow implicit and I'm not recognizing it, maybe through helper methods or classes?

I want to apply it to math operations to ensure 3 + 5 * 10 results in 53 instead of 80.

Upvotes: 2

Views: 208

Answers (1)

Jörg W Mittag
Jörg W Mittag

Reputation: 369468

The whole point of representing code as a tree is that the precedence is encoded in the tree structure itself, so that you do not need to care about it.

Upvotes: 1

Related Questions