我正在 C++ 中为参数化字符串实现解析器(用于为终端指定一些终端功能)。然后我在 terminfo 的手册页上遇到了这个:
%? expr %t thenpart %e elsepart %;
This forms an if-then-else. The %e elsepart is optional. Usually the %? expr part pushes
a value onto the stack, and %t pops it from the stack, testing if it is nonzero (true). If
it is zero (false), control passes to the %e (else) part.
所以,我的问题是:
正如手册页所说,expr
字符串中的部分通常可以将值压入堆栈,那么在该部分中还可以做哪些其他事情expr
,即在expr部分可以进行哪些其他操作除了将值压入堆栈?