Search CTRL + K

Terminal Symbol

终结符(terminal symbol) 是形式语言中的基本符号,能在形式语法的推导规则左手端和右手端作为字符串存在,不能分解为更小的单位。

举例:

xxaxax

在这个语法推导规则中,没有规则可以展开 a,所以 a 就是一个终结符;而有两个规则可以把 x 展开成别的符号,所以 x 就是 非终结符


Wikipedia

Terminal symbols are symbols that may appear in the outputs of the production rules of a formal grammar and which cannot be changed using the rules of the grammar. Applying the rules recursively to a source string of symbols will usually terminate in a final output string consisting only of terminal symbols.[1]


  1. https://en.wikipedia.org/wiki/Terminal_and_nonterminal_symbols ↩︎