欢迎来到天天文库
浏览记录
ID:40588458
大小:63.00 KB
页数:10页
时间:2019-08-04
《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
此文档下载收益归作者所有