ReplState.java 文件源码

java
阅读 21 收藏 0 点赞 0 评论 0

项目:L42 作者:
public static ReplState start(String code){
Program p=Phase1CacheKey._handleCache();
try{
  boolean cached=p!=null;
  if(!cached){
    Timer.activate("RunningWithoutParsedCache");
    p= L42.parseAndDesugar("Repl",code);
    }
  ProgramReduction pr = new ProgramReduction(Paths.get("localhost","ReplCache.C42"),!cached);
  ReplState res=new ReplState(code,p.top(),p,pr);
  res.desugaredL=res.reduction.allSteps(res.p);
  res.p=res.p.updateTop(res.desugaredL);
  res.code=code.substring(1, code.length()-1); //to remove start and end {}
  return res;
  }
  catch(org.antlr.v4.runtime.misc.ParseCancellationException parser){
    System.out.println(parser.getMessage());
    return null;
    }
  catch(ErrorMessage msg){
    ErrorFormatter.topFormatErrorMessage(msg);
    return null;
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号