您好,欢迎访问三七文档
当前位置:首页 > 临时分类 > 廖力编译原理课件第1章
1xobjects@seu.edu.cn379323521.1•1)–––•––31.12)•–——•–•–41.12)•–——51.12)•–————61.12)•••–––71.2••–1.–2.–3.–4.–5.81.2•••••9101.21.•–•–11•••:•:•:Void,int,floata,b,c,d,x,y,jisuan50+,-,*,={};,()Voidjisuan(){inty,c,d;floatx,a,b;x=a+b*50;y=c+)d*(x+b;}121.21.••––––•131.2•••••141.22.•–•–•–BNFA::=B|C15•A::=V=E•E::=T|E+T•T::=F|T*F•F::=V|(E)|C•V::=•C::=161.22.•–derive)(reduce)•–•–17•A⇒V=E⇒⇒x=a+b*50•P4V=E+T⇒V=E+T*F⇒V=E+T*C⇒V=E+T*50⇒V=E+F*50⇒V=E+V*50⇒V=E+b*50⇒V=T+b*50⇒V=F+b*50⇒V=V+b*50⇒V=a+b*5018•A⇒V=E⇒•⇒x=a+b*50•P4x=E⇒x=E+T⇒x=T+T⇒x=F+T⇒x=V+T⇒x=a+T⇒x=a+T*F⇒x=a+F*F⇒x=a+V*F⇒x=a+b*F⇒x=a+b*C19•Cy=c+)d*(x+b•(•A⇒V=E⇒V=E+T⇒V=E+F⇒V=E+V⇒V=E+b⇒V=T+b⇒V=T*F+b⇒V=T*V+b⇒V=T*x+b••C20••AabV=ETT*FFFCxE+TVV50Eg:x=a+b*5021•y=c+)d*(x+bAxV=ETFT*FVE+TVb221.2•••••233.••––•–24•x=a+b*50xT3=4T3T2a+3T2T1b*2T1501251.2•••••264.•••27••For(k=1;k=100;k++)•{m=i+10*k;•n=j+10*k;•}K=1;10Ifk=100then{m=i+10*k;n=j+10*k;k++;goto10;}28(9)(2)j(8)K1k+(7)NT2j+(6)T2K10*(5)MT1i+(4)T1K10*(3)(9)K100j(2)K1(1)RESULTARG2ARG1OPK=1;10Ifk=100then{m=i+10*k;n=j+10*k;k++;goto10;}299(4)j8k1k+7n10n+6m10m+5(9)k100J4k1=3nj=2mi1RESULTARG2ARG1OP301.2•••••315.••–:––32336.•–•–341•knmINFORMATIONNAME35214410…….……INFORMATIONNAME363•1INCWAP…….……INFORMATIONNAME374return9(4)j8k1k+7n10n+6m10m+5(9)k100J4k1=3nj=2mi1RESULTARG2ARG1OP387.•••:–:–398.•–••–––40411.3•1.•2.–•3.–421.3•4.•5.:–LEX()YACC(LALR)•6.431.4•–––44•••
本文标题:廖力编译原理课件第1章
链接地址:https://www.777doc.com/doc-1776894 .html