Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我不知道 BNF 或 EBNF 中的冒号是什么意思。它没有在互联网上的任何地方列出。不管怎样,我的教授决定把它放在作业中。我认为他将其与分号或其他东西混淆了。我仍然不确定分号是什么意思。这是一些上下文:
给定以下声明的 CFG(上下文无关语法):
D -> D ; D D -> id : T T -> char T -> integer
给出定义标识符类型的属性语法(id 代表标识符)。
有人认为他们可以提供帮助吗?
;和只是终端,:就像和一样。所以你的代码可能是这样的: idcharinteger
;
:
id
char
integer
x : char ; y : integer ; z : char