Skip to content
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

Open
ccckmit opened this issue Mar 16, 2022 · 43 comments
Open

Comments

@ccckmit
Copy link
Contributor

ccckmit commented Mar 16, 2022

參考: https://github.com/ccc-c/c6/wiki/

補充:

  1. 若覺得 do ... while 語法太沒挑戰性,可以改加 for 迴圈語法 (分數會更高)。
  2. 你先 fork c6 專案,然後才去改寫。
@z22756392z
Copy link

@stereomp3
Copy link

stereomp3 commented Mar 16, 2022

// 需要在前面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 的時候跳,這裡是跳入迴圈
  }

@yucing
Copy link

yucing commented May 10, 2022

110910511 蘇郁晴
https://github.com/yucing/sp110b/wiki/e2.md

@Mocha777
Copy link

Mocha777 commented Jun 5, 2022

@shaoan901226
Copy link

110910518 黃紹安
https://github.com/shaoan901226/sp/wiki/HOMEWORK2

@nakirifumiya
Copy link

110910501 王澤瑋
https://github.com/nakirifumiya/sp110b/wiki/hw2

@jifkavnb0205
Copy link

110810507 李安博

@Lin610313
Copy link

110910506林庭光
https://github.com/Lin610313/sp110b/wiki/work2.md

@RyanChen-01
Copy link

110910515 陳文吉
https://github.com/RyanChen-01/sp110b/wiki/hw2.md

@stayjay
Copy link

stayjay commented Jun 12, 2022

110910507王證傑
https://github.com/stayjay/sp110b/wiki/homework2

@qweasd049564
Copy link

資工三 110810509 蘇乾羽
https://github.com/qweasd049564/sp110b/blob/master/hw/hw2.md

@Paouser
Copy link

Paouser commented Jun 12, 2022

110910522 劉煒辰

@Sakura01210
Copy link

110910508 王冠文

@404HK416
Copy link

110810403 蘇彥華

@zraiz
Copy link

zraiz commented Jun 14, 2022

資工二 110911542 邵南翔
https://github.com/zraiz/sp110b/blob/master/Homework/02/Homeowrk02.md

@yumao57
Copy link

yumao57 commented Jun 14, 2022

資工二 110910529 劉宸羽
https://github.com/yumao57/sp110b/wiki/%E7%BF%92%E9%A1%8C%E4%BA%8C

@choco427
Copy link

choco427 commented Jun 14, 2022

@Roy-Roo
Copy link

Roy-Roo commented Jun 14, 2022

@kaifeng273
Copy link

@patrick901218
Copy link

patrick901218 commented Jun 15, 2022

@Kenttsai1
Copy link

110910509 蔡宗霖

@jiajianong
Copy link

@zhengyucen
Copy link

@WForU
Copy link

WForU commented Jun 15, 2022

資工二 110911543 何文旺
https://github.com/WForU/sp110b/wiki/HW2.md

@wukunru
Copy link

wukunru commented Jun 15, 2022

資工二110910510吳昆儒
https://github.com/wukunru/sp110b/wiki/%E7%BF%92%E9%A1%8C%E4%BA%8C

@Uriel58
Copy link

Uriel58 commented Jun 15, 2022

@gakuplusq
Copy link

gakuplusq commented Jun 15, 2022

@Selesfia
Copy link

@qwezxca123
Copy link

@mozi5269
Copy link

@derek120432
Copy link

@ceen123
Copy link

ceen123 commented Jun 16, 2022

@QuiLinxinag
Copy link

@Soober9260
Copy link

@Vialbum
Copy link

Vialbum commented Jun 16, 2022

@po-hsiang666
Copy link

@OohelloworldoO
Copy link

OohelloworldoO commented Jun 17, 2022

資工二 110910539 鄭智陽
https://github.com/OohelloworldoO/sp110b/wiki/exercise-2

@al2698
Copy link

al2698 commented Jun 17, 2022

@ChiaYunn
Copy link

110810535

@daniel74859641
Copy link

110910563陳威宇
https://github.com/daniel74859641/-/wiki

@nnnnnnn1266
Copy link

@wei-annn
Copy link

110910504趙唯安
https://github.com/wei-annn/sp110b/wiki/hw2.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests