【发布时间】:2016-09-07 09:45:46
【问题描述】:
您好,我不明白为什么在 assgnStmt 生产中存在冲突。我正在使用 coco/R,我收到“assgnStmt 中的 LL1 警告:ID 是可删除结构的开始和继任者”。 谢谢。
COMPILER program
CHARACTERS
Letter= 'a'..'z'.
Digit= '0'..'9'.
TOKENS
NUM= Digit {Digit}.
ID= Letter {Letter}.
PRODUCTIONS
program
= stmts
.
stmts = assgnStmt { assgnStmt ';' } .
assgnStmt
= {ID "==" } expr
.
expr = term { ('+' | '-') term } .
term = factor { ( '*' | '/' ) factor } .
factor
= '(' expr ')'
| ID
| NUM
.
END program.
【问题讨论】:
标签: compilation compiler-warnings formal-languages