Description: 【目的】 设计一个算符优先分析器,理解优先分析方法的原理。
【要求】 使用算符优先分析算法分析下面的文法:
E’ → #E#
E → E+T | T
T → T*F | F
F → P^F | P
P → (E) | i
其中i可以看作是一个终结符,无需作词法分析。具体要求如下:
1. 如果输入符号串为正确句子,显示分析步骤,包括分析栈中的内容、优先关系、输入符号串的变化情况;
2. 如果输入符号串不是正确句子,则指示出错位置。
-[Objective] To design a priority analyzer operator, understanding the principle of priority analysis. ] [Requirements analysis algorithm using the operator priority grammar analysis of the following: E →# E# E → E+ T | TT → T* F | FF → P ^ F | PP → (E) | i which i can be seen as is a terminator, no analysis of Authors. Specific requirements are as follows: 1. If you enter the correct sentence for the string of symbols, showing analysis steps, including analysis of the contents of the stack to give priority to the relationship between input symbols string changes 2. If the input string is not correct sentence symbols are also given the wrong location . Platform: |
Size: 3072 |
Author:王东旭 |
Hits: