Browse Source

Small change in ExpandPropRefsAndLabels: either properties list or lable list can be omitted (and is then ignored).

git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@10901 bbc10eb1-c90d-0410-af57-cb519fbb1720
master
Dave Parker 10 years ago
parent
commit
87b50d7da2
  1. 17
      prism/src/parser/visitor/ExpandPropRefsAndLabels.java

17
prism/src/parser/visitor/ExpandPropRefsAndLabels.java

@ -31,9 +31,10 @@ import parser.type.*;
import prism.PrismLangException;
/**
* Expand property references and labels, return result.
* Property expansion is done recursively.
* Special labels "deadlock", "init" and any not in label list are left.
* Expand property references and labels, return result.
* Property expansion is done recursively.
* Either properties file or label list can be omitted (set to null)
* Special labels "deadlock", "init" and any not in label list are left.
*/
public class ExpandPropRefsAndLabels extends ASTTraverseModify
{
@ -54,6 +55,11 @@ public class ExpandPropRefsAndLabels extends ASTTraverseModify
Type t;
Expression expr;
// Skip this if label list is missing
if (labelList == null) {
return e;
}
// See if identifier corresponds to a label
i = labelList.getLabelIndex(e.getName());
if (i != -1) {
@ -84,6 +90,11 @@ public class ExpandPropRefsAndLabels extends ASTTraverseModify
Type t;
Expression expr;
// Skip this if label list is missing
if (propertiesFile == null) {
return e;
}
// See if name corresponds to a property
prop = propertiesFile.lookUpPropertyObjectByName(e.getName());
if (prop != null) {

Loading…
Cancel
Save