-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
習題 2 : 請為 c6 編譯器加上 do ... while 語法的程式碼 #10
Comments
// 需要在前面enum加上 Do,後面的compiler 的 p加上 do
else if (tk == Do){
next();
a = e + 1;
stmt();
if (tk == While) next(); else { printf("%d: open while expected\n", line); exit(-1); }
if (tk == '(') next(); else { printf("%d: open paren expected\n", line); exit(-1); }
expr(Assign);
if (tk == ')') next(); else { printf("%d: close paren expected\n", line); exit(-1); }
if (tk == ';') next(); else { printf("%d: close ; expected\n", line); exit(-1); }
*++e = BNZ; *++e = (int)a; // BNZ是代表不是 0 的時候跳,這裡是跳入迴圈
} |
110910511 蘇郁晴 |
110910518 黃紹安 |
110910501 王澤瑋 |
110910506林庭光 |
110910515 陳文吉 |
110910507王證傑 |
資工三 110810509 蘇乾羽 |
資工二 110911542 邵南翔 |
資工二 110910529 劉宸羽 |
資工二 110911543 何文旺 |
資工二 110910539 鄭智陽 |
110910563陳威宇 |
110910504趙唯安 |
參考: https://github.com/ccc-c/c6/wiki/
補充:
The text was updated successfully, but these errors were encountered: