从Postfix到Expression-Tree算法(带有函数调用)
在查看了StackoveFlow中的所有相关条目以及经常谷歌搜索后,我找不到所需的算法。
具有与此相似的表达式(在后缀符号中):
"This is a string" 1 2 * 4.2 ceil mid "is i" ==
我需要一种将其转换为表达树的算法。 我发现许多地方可以解释如何进行这种转换,但是他们仅使用操作员(+, - ,*,&& ,,|等)。像上面的示例一样,当函数(零或更多参数)涉及函数(零或更多参数)时,我找不到如何执行操作。
为了清晰,上面的后缀表达方式将如下如下:使用infix符号:
mid( "This is a string", 1*2, ceil( 4.2 ) ) == "is i"
伪代码中的一般算法,Java或JavaScript或C tostfix 表达树)。
事先感谢一百万。
After reviewing all related entries in Stackoveflow and also after googleing a lot, I can not find the algorithm I need.
Having expressions similar to this one (in postfix notation):
"This is a string" 1 2 * 4.2 ceil mid "is i" ==
I need an algorithm that transforms it into an Expression Tree.
I've found many places that explain how this transformation can be done, but they only use operators (+,-,*, &&, ||, etc). I can not find how to do it when functions (with zero or more arguments) are involved, like in the example above.
Just for clarity, the postfix expression above will look as follows when using infix notation:
mid( "This is a string", 1*2, ceil( 4.2 ) ) == "is i"
A general algorithm in pseudo-code or Java or JavaScript or C would be very much appreciated (please keep this in mind: from postfix to expression-tree).
Thanks a million in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论