Hot Search : Source embeded web remote control p2p game More...
Location : Home Search - file Tree B
Search - file Tree B - List
设计一个四则表达式分析软件,其接受从文件或键盘输入的四则表达式(运算对象支持整数和变量),给出该表达式的二叉树表达形式,并在键盘上按后续遍历方式输出该二叉树。 例如,输入a+b*c,输出 a b c * + 提示:参考下列的设计指导: 递归下降分析法实验设计思想及算法 为G的每个非终结符号U构造一个递归过程,不妨命名为U。U的产生式的右边指出这个过程的代码结构: (1)若是终结符号,则和向前看符号对照,若匹配则向前进一个符号;否则出错。 (2)若是非终结符号,则调用与此非终结符对应的过程。当A的右部有多个产生式时,可用选择结构实现。-Design a four-expression analysis software, which accepts four expressions from a file or keyboard input (support integer operands and variables), given expression in the form of a binary tree of the expression, and on the keyboard, press the subsequent traversal of the binary output.       For example, enter a+ b* c, output a b c*+       Note: Refer to the following design guidelines:         Recursive descent experimental design ideas and algorithm analysis           To construct each nonterminal U G a recursive process, it may be named as U. U generates right-hand side indicates the code structure of the process:           (1) If the end of the symbol, and lookaheads contrast, if the match is to advance a symbol otherwise error.           (2) If the non-terminal symbol, then call this nonterminal corresponding process. When there are multiple right part A of production, s
Date : 2026-01-10 Size : 149kb User : jchen
CodeBus is one of the largest source code repositories on the Internet!
Contact us :
1999-2046 CodeBus All Rights Reserved.