|
A metasyntax describes the allowable structure and composition of phrases and sentences of a metalanguage, which is used to describe either a natural language or a computer programming language. Some of the widely used formal metalanguages for computer languages are Backus–Naur Form (BNF), Extended Backus–Naur Form (EBNF), Wirth syntax notation (WSN), and Augmented Backus–Naur Form (ABNF). These metalanguages have their own metasyntax each composed of terminal symbols, nonterminal symbols, and ''metasymbols''. A terminal symbol, such as a word or a token, is a stand-alone structure in a language being defined. A nonterminal symbol represents a syntactic category, which defines one or more valid phrasal or sentence structure consisted of an n-element subset. Metasymbols provide syntactic information for denotational purposes in a given metasyntax. Terminals, nonterminals, and metasymbols do not apply across all metalanguages. Typically, the metalanguage for token-level languages (formally called “regular languages”) does not have nonterminals because nesting is not an issue in these regular languages. English, as a metalanguage for describing certain languages, does not contain metasymbols since all explanation could be done using English expression. There are only certain formal metalanguages used for describing recursive languages (formally called context-free languages) that have terminals, nonterminals, and metasymbols in their metasyntax. ==Element of metasyntax== * Terminals: a stand-alone syntactic structure. Terminals could be denoted by double quoting the name of the terminals. :e.g. “else” , “if”, “then”, “while” * Nonterminals: a symbolic representation defining a set of allowable syntactic structures that is composed of a subset of elements. Nonterminals could be denoted by angle bracketing the name of the nonterminals. :e.g. * Metasymbol: a symbolic representation denoting syntactic information. :e.g. := , |, {}, (), [], * 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「Metasyntax」の詳細全文を読む スポンサード リンク
|