Looking for learning resource regarding operator associativity and precedence for a parser that I am building

StackOverflow https://stackoverflow.com/questions/10284141

문제

I'm using Parboiled to build a parser for a search syntax that has several operators of varying precedence and associativity. As this will be my first parser, it would be really nice to see some good examples of how precedence and associativity are generally handled. In addition we have some unusual operators which don't appear to have associativity, similar to Python's ternary < operator (e.g. a<b<c => (a<b)&&<b<c>).

Can you direct me to good resources and examples regarding parsing operators of different associativity and precedence?

올바른 솔루션이 없습니다

다른 팁

See the Calculator examples for examples on how to do this.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top