IEEE Std 1800‑2023 Annex A Formal syntax(附录A 正式BNF语法)
格式 A|交错分层对照,🔤原文、📝译文;保留章节编号、BNF 语法、代码示例,可对照原版 PDF 阅读。
Annex A Formal syntax 附录 A 正式 BNF 语法
A.1 General 概述
🔤 原文:
This annex contains the formal Backus‑Naur‑Form (BNF) syntax for SystemVerilog. This syntax defines the syntactically valid grammar for SystemVerilog source text. This BNF is normative; whenever there is conflict between descriptive text in main clauses and this BNF, Annex A takes precedence.The BNF describes syntax structure only; semantic rules are defined in the main body clauses of this standard. Syntax alone does not guarantee valid SystemVerilog code. Even code that matches BNF rules can violate semantic constraints and shall be treated as erroneous.
📝 译文:
本附录包含 SystemVerilog 的巴科斯范式(BNF)正式语法。该语法定义 SystemVerilog 源文本的合法文法。本 BNF 属于规范性内容;当正文章节描述文字与本 BNF 存在冲突时,以附录 A 为准。BNF 仅描述语法结构;语义规则由本标准正文各章节定义。仅仅语法符合 BNF 并不能保证 SystemVerilog 代码合法。即使代码匹配 BNF 规则,仍可能违反语义约束,此时应判定为错误代码。
🔤 原文 NOTE:
NOTE‑This BNF is not intended to be used directly as input to parser‑generator tools. It is written for human readability; some ambiguities and lexical‑level details are handled in main clause text.
📝 译文 NOTE:
注:该 BNF 并非设计为直接输入给语法生成解析器工具;它面向人类阅读。部分歧义、词法层细节在正文章节文本中处理。
A.2 BNF notation conventions BNF 标记约定
🔤 原文:
Lower‑case identifiers: non‑terminal syntactic categories (e.g.
module_declaration).Bold‑red font tokens: terminal symbols — keywords, operators, punctuation characters that appear literally in source code.
Vertical bar
|: separates alternative productions.Square brackets
[ ... ]: optional item, zero or one occurrence.Braces
{ ... }: repeated item; zero or more occurrences.Subscript
*/+are NOT used; repetition is exclusively expressed by curly braces.Comments inside BNF are for explanation only, not part of grammar.
📝 译文:
小写标识符:非终结符语法类别(例如
module_declaration
392



被折叠的 条评论
为什么被折叠?



