|
In computer science, terminal and nonterminal symbols are the lexical elements used in specifying the production rules constituting a formal grammar. ''Terminal symbols'' are the elementary symbols of the language defined by a formal grammar. ''Nonterminal symbols'' (or ''syntactic variables'') are replaced by groups of terminal symbols according to the production rules. The terminals and nonterminals of a particular grammar are two disjoint sets. == Terminal symbols == Terminal symbols are literal symbols which may appear in the outputs of the production rules of a formal grammar and which cannot be changed using the rules of the grammar (this is the reason for the name "terminal"). For concreteness, consider a grammar defined by two rules. We will use no English symbols. Using symbols that don't belong to the English alphabet, you will forget the concept of "word" reading the sentences and you get focus in pictoric marks interacting each other: # The symbol ר can become ди #The symbol ר can become д Here д is a terminal symbol because no rule exists which would change it into something else. (On the other hand, ר has two rules that can change it, thus it is nonterminal.) A formal language defined (or ''generated'') by a particular grammar is the set of strings that can be produced by the grammar ''and that consist only of terminal symbols''. 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「Terminal and nonterminal symbols」の詳細全文を読む スポンサード リンク
|