zju 08 exam paper

zju 08 exam paper

ID:40588458

大小:63.00 KB

页数:10页

时间:2019-08-04

zju 08 exam paper_第1页
zju 08 exam paper_第2页
zju 08 exam paper_第3页
zju 08 exam paper_第4页
zju 08 exam paper_第5页
资源描述:

《zju 08 exam paper》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、一、Markeachstatementtrueorfalse(20cents)1.Scopesofthevariablesareintercrossedsometimes.2.Yacccannotuseambiguousgrammars.3.BothDFAandNFAcanrecognizeregularset.4.Agrammarisambiguousifithastwodifferentderivationsortwodifferentparsetreesforasentence.5.GrammarswithleftrecursioneliminatedareLL(1).6.Al

2、lLL(1)grammarscanbeparsedbyLALRparser.7.Codegenerationdependsondetailedinformationaboutthetargetarchitecture,anddoesn’tcarethecharacteristicsofthesourcelanguage.8.ThebestchoiceofdatastructureofthesymboltableisHASHtable.9.AnL-valuecannotoccurontherightof10anassignmentstatement.10.Anintermediater

3、epresentationisakindofmachinelanguagewithcommittingtotoomuchmachine-specificdetail.一、SingleChoice(15cents)1.Stringsoverthealphabet{a,b,c}wherethelengthofthestringisevencanbegeneratedbyregularexpression___:[A].((a

4、b

5、c)(a

6、b

7、c))*[B].(a

8、b

9、c)(aa

10、bb

11、cc)*(a

12、b

13、c)[C].(aa

14、bb

15、cc)*[D].(a

16、b

17、c)*2.Whichofthef

18、ollowingisnotonlyfoundinastackframe(activationrecord)?[A]staticvariables[B]returnaddress[C]savedregisters[D]parameters3.TheelementsinaLRParsingtablearelabeledwiththefollowingkindsofactions10except___?[A].Shift[B].Goto[C].Accept[D].Push4.IntheproductionB→αAγ,WhichwouldnotbeintheFOLLOW(A)Set?[A].

19、ε[B].FIRST(γ)[C].FOLLOW(B)[D].$5.Whichgrammarparserbelowistheleastpowerful?[A].LL(0)[B].LR(0)[C].SLR[D].LR(1)6.Hereisagrammar:X→aX→Y→bY→XZ→cZ→XYZW→dW→XYWhichsymbolisnotnullable?[A].X[B].Y[C].Z[D].W7.WhichelementwouldnotappearinthestackofLRparser?10[A].terminal[B].nonterminal[C].$[D].state8.Norm

20、ally,wedoerrorrecoverywithmethodsexcept____?[A].adderrorproduction[B].modifytheparsingtables[C].eliminatetheconflict[D].modifytheparsingengine9.Whichofthefollowingiscommonlyfoundinastackframe(activationrecord)?[A]fppointer[B]sppointer[C]staticvariable[D]globalvariable10.Manycompilersaredividedi

21、ntotwolargelyindependentpasses:afrontend,responsibleforanalyzingsourcecode,andabackend,responsibleforgenerating10targetcode.(Theymayalsoincludeathird,intermediatephase,responsibleforcodeimprovement.)Whatisthemostimportantmotivatio

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。