From 87b50d7da2c4f2a07712105bd6bf6b3af0ad5e98 Mon Sep 17 00:00:00 2001 From: Dave Parker Date: Thu, 19 Nov 2015 19:01:04 +0000 Subject: [PATCH] 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 --- .../parser/visitor/ExpandPropRefsAndLabels.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/prism/src/parser/visitor/ExpandPropRefsAndLabels.java b/prism/src/parser/visitor/ExpandPropRefsAndLabels.java index 4727a774..9ce33246 100644 --- a/prism/src/parser/visitor/ExpandPropRefsAndLabels.java +++ b/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) {