public MplProgram assemble(File programFile) throws IOException {
programFile = getCanonicalFile(programFile);
// Don't cache the first interpreter, because it's program is mutable and will be changed
MplInterpreter main = MplInterpreter.interpret(programFile, context);
MplProgram program = main.getProgram();
programBuilder = new MplProgramBuilder(program, programFile);
resolveReferences(main.getReferences().values());
if (!program.isScript()) {
doIncludes();
}
MplProgram result = programBuilder.getProgram();
boolean containsRemoteProcess = result.getProcesses().stream()//
.anyMatch(p -> p.getType() == ProcessType.REMOTE);
if (context.getErrors().isEmpty() && !containsRemoteProcess) {
context.addError(
new CompilerException(new MplSource(programFile, "", new CommonToken(MplLexer.PROCESS)),
"This file does not include any remote processes"));
}
return result;
}
MplProgramAssemler.java 文件源码
java
阅读 20
收藏 0
点赞 0
评论 0
项目:MPL
作者:
评论列表
文章目录