In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail how to achieve grammar generation in C#. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
The C # language has a lot to learn. Here we mainly introduce the production of C # grammar, including XX and so on.
Lexical grammar and syntactic grammar are represented by C # grammar production. Each grammar production defines a non-ending symbol and its possible extension (a sequence of non-terminators or Terminators). In grammar production, non-closing symbols are displayed in italics, while closing symbols are displayed in equal-width fonts.
The * line of the C # grammar generator is the name of the non-ending symbol defined by the production, followed by a colon. Each subsequent indentation lists a possible extension in the form of a sequence of non-Terminators or Terminators. For example, production:
◆ while-statement: (while statement:)
◆ while (boolean-expression)
◆ embedded-statement (while) embedded statement)
A while statement is defined, which starts with the tag while, followed by the tag "(", Boolean expression, tag ")" and the embedded statement.
When there is more than one possible non-closing symbol extension, list these possible extensions (each extension on a separate line). For example, production:
◆ statement-list: (statement list:)
◆ statement (statement)
◆ statement-list statement (statement list statement)
Define a list of statements that either contains only one statement or consists of a list of statements followed by a statement. In other words, the definition is recursive and the statement list consists of one or more statements.
If a symbol is suffixed with "optional" below, it indicates that the symbol is optional. Production:
Block: (block:)
{statement-listopt} ({statement list optional})
Is a short form of the following production:
Block: (block:)
{}
{statement-list} ({statement list})
It defines a block that consists of a list of optional statements enclosed in "{" and "}" tags.
Options are usually listed on separate lines, but when there are many options, you can add the phrase "one of the following" before the given extension list on a single line. This is just a short form of listing each option on a separate line.
This is the end of the article on "how to achieve grammar generation in C#". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.