Skip to content
Snippets Groups Projects
Commit c7fcb9a1 authored by Jens Bendisposto's avatar Jens Bendisposto
Browse files

fixed PROBPLUGIN-38

parent 267d647a
No related branches found
No related tags found
No related merge requests found
...@@ -10,8 +10,10 @@ import java.util.List; ...@@ -10,8 +10,10 @@ import java.util.List;
import java.util.Set; import java.util.Set;
import org.apache.commons.lang.ObjectUtils; import org.apache.commons.lang.ObjectUtils;
import org.eventb.core.IContextRoot;
import org.eventb.core.IEventBRoot; import org.eventb.core.IEventBRoot;
import org.eventb.core.IMachineRoot; import org.eventb.core.IMachineRoot;
import org.eventb.core.ISCContextRoot;
import org.eventb.core.ISCEvent; import org.eventb.core.ISCEvent;
import org.eventb.core.ISCIdentifierElement; import org.eventb.core.ISCIdentifierElement;
import org.eventb.core.ISCMachineRoot; import org.eventb.core.ISCMachineRoot;
...@@ -60,8 +62,7 @@ public class EventBAnimatorPart implements LanguageDependendAnimationPart { ...@@ -60,8 +62,7 @@ public class EventBAnimatorPart implements LanguageDependendAnimationPart {
public void parseExpression(final IPrologTermOutput pto, public void parseExpression(final IPrologTermOutput pto,
final String expression1, final boolean wrap) final String expression1, final boolean wrap)
throws ProBParseException { throws ProBParseException {
final String expression = FormulaTranslator.translate( final String expression = FormulaTranslator.translate(expression1);
expression1);
final FormulaFactory ff = FormulaFactory.getDefault(); final FormulaFactory ff = FormulaFactory.getDefault();
final IParseResult parseResult = ff.parseExpression(expression, final IParseResult parseResult = ff.parseExpression(expression,
LanguageVersion.LATEST, null); LanguageVersion.LATEST, null);
...@@ -77,8 +78,7 @@ public class EventBAnimatorPart implements LanguageDependendAnimationPart { ...@@ -77,8 +78,7 @@ public class EventBAnimatorPart implements LanguageDependendAnimationPart {
public void parsePredicate(final IPrologTermOutput pto, public void parsePredicate(final IPrologTermOutput pto,
final String predicate1, final boolean wrap) final String predicate1, final boolean wrap)
throws ProBParseException { throws ProBParseException {
final String predicate = FormulaTranslator.translate( final String predicate = FormulaTranslator.translate(predicate1);
predicate1);
final FormulaFactory ff = FormulaFactory.getDefault(); final FormulaFactory ff = FormulaFactory.getDefault();
final IParseResult parseResult = ff.parsePredicate(predicate, final IParseResult parseResult = ff.parsePredicate(predicate,
LanguageVersion.LATEST, null); LanguageVersion.LATEST, null);
...@@ -127,9 +127,18 @@ public class EventBAnimatorPart implements LanguageDependendAnimationPart { ...@@ -127,9 +127,18 @@ public class EventBAnimatorPart implements LanguageDependendAnimationPart {
private ITypeEnvironment getTypeEnvironment(final FormulaFactory ff) private ITypeEnvironment getTypeEnvironment(final FormulaFactory ff)
throws ProBParseException { throws ProBParseException {
final ITypeEnvironment typeEnv; ITypeEnvironment typeEnv = null;
try { try {
if (root instanceof IMachineRoot)
typeEnv = root.getSCMachineRoot().getTypeEnvironment(ff);
if (root instanceof ISCMachineRoot)
typeEnv = root.getSCMachineRoot().getTypeEnvironment(ff); typeEnv = root.getSCMachineRoot().getTypeEnvironment(ff);
if (root instanceof IContextRoot)
typeEnv = root.getSCContextRoot().getTypeEnvironment(ff);
if (root instanceof ISCContextRoot)
typeEnv = root.getSCContextRoot().getTypeEnvironment(ff);
} catch (RodinDBException e) { } catch (RodinDBException e) {
throw rodin2parseException(e); throw rodin2parseException(e);
} }
...@@ -190,8 +199,7 @@ public class EventBAnimatorPart implements LanguageDependendAnimationPart { ...@@ -190,8 +199,7 @@ public class EventBAnimatorPart implements LanguageDependendAnimationPart {
private Predicate parseTransPredicate(final String predicateString, private Predicate parseTransPredicate(final String predicateString,
final ISCEvent event) throws ProBParseException { final ISCEvent event) throws ProBParseException {
final String utf8String = FormulaTranslator.translate( final String utf8String = FormulaTranslator.translate(predicateString);
predicateString);
final FormulaFactory ff = FormulaFactory.getDefault(); final FormulaFactory ff = FormulaFactory.getDefault();
final IParseResult parseResult = ff.parsePredicate(utf8String, final IParseResult parseResult = ff.parsePredicate(utf8String,
LanguageVersion.LATEST, null); LanguageVersion.LATEST, null);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment