我一直試圖證明一個語法模棱兩可,從我理解它的不是,而是根據這個問題;它應該是模棱兩可的。 語法是 S -> AB | aaB
A -> a | Aa
B -> b
一直使用IVE字符串爲AAAB。從看起來,我沒有看到任何方式左右樹可以不同。首先字符串是AB或aaB形式,如果它的aaB形式,遊戲結束,如果它的AB形式,你可以以a結尾,或者在Aa中繼續另一個分支。
讓我們假設情況。 struct Top
{
int x;
};
struct Left : public Top
{};
struct Right : public Top
{};
struct Bottom : public Left, public Right
{
void foo()
{
Left::x; // Normal co