摘要
介绍一种实现算术表达式识别的模式匹配算法,讨论了通过将表达式分解成项和因子并按ASCII码序重新组合成表达式的标准形式,然后将输入模式的标准形和样本标准形进行字符串比较,从而实现算术表达式识别的设计思想和算法步骤,并给出了一个用TurboPascal语言实现这一算法的高级语言源程序.
Through resolving arithmetic expression into factores and terms, rearranging them into the standard form in accordance with ASCII code's order, and comparing input pattern's standard form to sample's, the author describes an algorithm for implementation of the pattern matching of arithmetic expression recognition, and discusses the design idea and implementation technique in this paper. Furthermore, a implementation program in Turbo pascal language is shown.
关键词
算术表达式
模式匹配
算法
Arithmetic expression
pattern matching
symbol manipulating
standard form
charactor comparison