Browse Source

Undo accidental part of last commit.

git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@10465 bbc10eb1-c90d-0410-af57-cb519fbb1720
master
Dave Parker 11 years ago
parent
commit
32e6c16015
  1. 25
      prism/src/prism/Prism.java

25
prism/src/prism/Prism.java

@ -1424,7 +1424,30 @@ public class Prism extends PrismComponent implements PrismSettingsListener
*/
public ModulesFile importPepaString(String s) throws PrismException, PrismLangException
{
String prismModelString = new PrismLanguageImporter().convert("pepa", s);
File pepaFile = null;
String modelString;
// create temporary file containing pepa model
try {
pepaFile = File.createTempFile("tempPepa" + System.currentTimeMillis(), ".pepa");
FileWriter write = new FileWriter(pepaFile);
write.write(s);
write.close();
} catch (IOException e) {
if (pepaFile != null)
pepaFile.delete();
throw new PrismException("Couldn't create temporary file for PEPA conversion");
}
// compile pepa file to string
try {
modelString = pepa.compiler.Main.compile("" + pepaFile);
} catch (pepa.compiler.InternalError e) {
if (pepaFile != null)
pepaFile.delete();
throw new PrismException("Could not import PEPA file:\n" + e.getMessage());
}
// parse string as prism model and return
return parseModelString(modelString);
}

Loading…
Cancel
Save