From d1468e2bd8670bab7e32401ca42941c052708d29 Mon Sep 17 00:00:00 2001 From: Dave Parker Date: Tue, 8 Dec 2015 00:58:02 +0000 Subject: [PATCH] Fix recent changes to ExpressionFilter: lower case keywords got lost. git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11019 bbc10eb1-c90d-0410-af57-cb519fbb1720 --- prism/src/parser/ast/ExpressionFilter.java | 34 ++++++++++++---------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/prism/src/parser/ast/ExpressionFilter.java b/prism/src/parser/ast/ExpressionFilter.java index b8ced851..264c0f56 100644 --- a/prism/src/parser/ast/ExpressionFilter.java +++ b/prism/src/parser/ast/ExpressionFilter.java @@ -39,33 +39,37 @@ public class ExpressionFilter extends Expression */ public enum FilterOperator { /** Minimum value of prop over all filter states */ - MIN, + MIN ("min"), /** Maximum value of prop over all filter states */ - MAX, + MAX ("max"), /** True for the filter states that yield the minimum value of prop */ - ARGMIN, + ARGMIN ("argmin"), /** True for the filter states that yield the maximum value of prop */ - ARGMAX, + ARGMAX ("argmax"), /** Number of filter states for which prop is true */ - COUNT, + COUNT ("count"), /** Sum of the value of prop for all filter states */ - SUM, + SUM ("sum"), /** Average of the value of prop over all filter states */ - AVG, + AVG ("avg"), /** Value of prop for the first (lowest-indexed) filter state */ - FIRST, + FIRST ("first"), /** Range (interval) of values of prop over all filter states */ - RANGE, + RANGE ("range"), /** True iff prop is true for all filter states */ - FORALL, + FORALL ("forall"), /** True iff prop is true for some filter states */ - EXISTS, + EXISTS ("exists"), /** Print the (non-zero) values to the log */ - PRINT, + PRINT ("print"), /** Print all (including zero) values to the log */ - PRINTALL, + PRINTALL ("printall"), /** Value for the single filter state (if there is more than one, this is an error) */ - STATE; + STATE ("state"); + public final String keyword; + FilterOperator(final String keyword) { + this.keyword = keyword; + } }; // Operator used in filter @@ -110,7 +114,7 @@ public class ExpressionFilter extends Expression { this.opName = opName; for (FilterOperator op : FilterOperator.values()) { - if (opName.equalsIgnoreCase(op.name())) { + if (op.keyword.equals(opName)) { opType = op; return; }