我有这个pegjs语法。如何从中删除左递归?
atom = term
/ "^"
/ "_"
/ "\\"
/ atom "."
/ atom "." label
/ atom ".(" labels ")"
term = [a-zA-Z0-9]+
labels = label ("|" label)*
label = ("+" / "-")* [A-Za-z0-9]+发布于 2014-08-24 08:52:44
应该是这样的.
atomStatement = atom "." / atom "." label / atom ".(" labels ")" / atom
atom = term
/ "^"
/ "_"
/ "\\"
term = [a-zA-Z0-9]+
labels = label ("|" label)*
label = ("+" / "-")* [A-Za-z0-9]+https://stackoverflow.com/questions/25227486
复制相似问题