本文整理汇总了Java中org.eclipse.epsilon.common.parse.problem.ParseProblem类的典型用法代码示例。如果您正苦于以下问题:Java ParseProblem类的具体用法?Java ParseProblem怎么用?Java ParseProblem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ParseProblem类属于org.eclipse.epsilon.common.parse.problem包,在下文中一共展示了ParseProblem类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: execute
import org.eclipse.epsilon.common.parse.problem.ParseProblem; //导入依赖的package包/类
public Object execute(String inputPath, String outputPath) throws Exception {
IEolExecutableModule module = createModule();
module.parse(toFileURI(getTransformation()));
if (module.getParseProblems().size() > 0) {
System.err.println("Parse errors occured...");
for (ParseProblem problem : module.getParseProblems()) {
System.err.println(problem.toString());
}
return null;
}
String outputURI = new File(outputPath).toURI().getPath();
for (IModel model : getModels(inputPath, outputURI)) {
module.getContext().getModelRepository().addModel(model);
}
Object result = module.execute();
module.getContext().getModelRepository().dispose();
return result;
}
开发者ID:djhuistra,项目名称:UnifyingAttackTrees,代码行数:20,代码来源:EpsilonTransformer.java
示例2: execute
import org.eclipse.epsilon.common.parse.problem.ParseProblem; //导入依赖的package包/类
public void execute() throws Exception {
module = createModule();
module.parse(getTransformationFile());
if (module.getParseProblems().size() > 0) {
System.err.println("Parse errors occured...");
for (ParseProblem problem : module.getParseProblems()) {
System.err.println(problem.toString());
}
System.exit(-1);
}
for (IModel model : getModels()) {
module.getContext().getModelRepository().addModel(model);
}
preProcess();
result = execute(module);
postProcess();
module.getContext().getModelRepository().dispose();
}
开发者ID:leondart,项目名称:FRaMED,代码行数:24,代码来源:EpsilonStandalone.java
示例3: execute
import org.eclipse.epsilon.common.parse.problem.ParseProblem; //导入依赖的package包/类
/**
* @throws Exception when either loading models or executing the EOL script
*
*/
public void execute() throws Exception {
module = createModule();
module.parse(getFile(getSource()));
if (module.getParseProblems().size() > 0) {
System.err.println("Parse errors occured...");
for (ParseProblem problem : module.getParseProblems()) {
System.err.println(problem.toString());
}
System.exit(-1);
}
for (IModel model : getModels()) {
module.getContext().getModelRepository().addModel(model);
}
preProcess();
result = execute(module);
postProcess();
module.getContext().getModelRepository().dispose();
}
开发者ID:adolfosbh,项目名称:cs2as,代码行数:28,代码来源:AbstractEolLauncher.java
示例4: validate
import org.eclipse.epsilon.common.parse.problem.ParseProblem; //导入依赖的package包/类
@Override
public List<String> validate(String derivationlogic) {
final IEolModule module = createModule();
final List<String> ret = new LinkedList<>();
try {
module.parse(derivationlogic);
for (ParseProblem p : module.getParseProblems())
ret.add(p.toString());
} catch (Exception e) {
LOGGER.error("Error while parsing EOL", e);
}
return ret;
}
开发者ID:mondo-project,项目名称:mondo-hawk,代码行数:15,代码来源:EOLQueryEngine.java
示例5: start
import org.eclipse.epsilon.common.parse.problem.ParseProblem; //导入依赖的package包/类
public static void start(String path)
{
try {
// Egl-Datei laden und Output setzen
EglFileGeneratingTemplateFactory eglTemplateFactory = new EglFileGeneratingTemplateFactory();
IEolExecutableModule module = new EglTemplateFactoryModuleAdapter(eglTemplateFactory);
System.out.println("Parsing template files...");
module.parse(new File(path+"Calender2HTML.egl").getAbsoluteFile());
// Fehler beim Parsen ausgeben
if (module.getParseProblems().size() > 0) {
System.err.println("Parse errors occured...");
for (ParseProblem problem : module.getParseProblems()) {
System.err.println(problem.toString());
}
}
// Metamodell hinzufügen
EmfModel model = new EmfModel();
StringProperties properties = new StringProperties();
properties.put(EmfModel.PROPERTY_NAME, "Mein Kalender");
properties.put(EmfModel.PROPERTY_FILE_BASED_METAMODEL_URI, path+"Calender.ecore");//"file:/" + new File(metamodel).getAbsolutePath());
properties.put(EmfModel.PROPERTY_MODEL_URI, "file:/" + new File(path+"mynew.calender").getAbsolutePath());
properties.put(EmfModel.PROPERTY_IS_METAMODEL_FILE_BASED, "true");
properties.put(EmfModel.PROPERTY_READONLOAD, true + "");
properties.put(EmfModel.PROPERTY_STOREONDISPOSAL, true + "");
model.load(properties, (IRelativePathResolver) null);
eglTemplateFactory.getContext().getModelRepository().addModel(model) ;
// Ausführen und in Datei schreiben
System.out.println( module.execute());
File file = new File(path+"calender.html");
FileOutputStream fop = new FileOutputStream(file);
if (!file.exists()) {
file.createNewFile();
}
byte[] contentInBytes = ((String) module.execute()).getBytes();
fop.write(contentInBytes);
fop.flush();
fop.close();
module.getContext().getModelRepository().dispose();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
开发者ID:Nielko,项目名称:MBSE-Vacation-Manager,代码行数:48,代码来源:StartEGL.java
注:本文中的org.eclipse.epsilon.common.parse.problem.ParseProblem类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论