zoukankan      html  css  js  c++  java
  • 编译原理 作业十五

    1.语法文法G[E]如下所示: 

    –E→E+T | E-T | T 

    –T→T* F | T/F | F 

    –F→P^ F | P 

    –P→(E) | i 

    要求构造出符合语义分析要求的属性文法描述

     解:

    E -> E+T     { E.place := newtemp; emit( E.place , ' := ' , E.place , ' + ' , T.place )}

    E -> E-T      { E.place := newtemp; emit( E.place , ' := ' , E.place , ' - ' , T.place )}

    E -> T          { E.place := newtemp; emit( E.place , ' := ' , T.place )}

    T -> T*F      { T.place := newtemp; emit( T.place , ' := ' , T.place , ' * ' , F.place )}

    T -> T/F      { T.place := newtemp; emit( T.place , ' := ' , T.place , ' / ' , F.place )}

    T -> F         { T.place := newtemp; emit( T.place , ' := ' , F.place )}

    F -> P^F      { F.place := newtemp; emit( F.place , ' := ' , P.place , ' ^ ' , F.place )}

    F -> P         { P.place := newtemp; emit( F.place , ' := ' , P.place )}

    P -> (E)       { P.place :=  E.place;}

    P -> i           { if  i <> nil   then  emit( P.place , ':=' , i.place )   else error}

  • 相关阅读:
    Jboss下jaxws的开发
    Jboss as 服务器基本设置
    classloader常见问题总结
    Servlet容器 Jetty
    Jetty 的工作原理以及与 Tomcat 的比较
    resin设置jvm参数
    Solr4.0使用
    Solr 4.0部署
    Solr 搜索功能使用
    HttpSolrServer 实例管理参考,来自org.eclipse.smila.solr
  • 原文地址:https://www.cnblogs.com/zzkai/p/12089521.html
Copyright © 2011-2022 走看看