From 89668d36167846e002d0f6dcdc1034b5fee44ce3 Mon Sep 17 00:00:00 2001 From: "Benjamin J. Culkin" Date: Thu, 11 Oct 2018 22:11:20 -0300 Subject: Update --- src/main/java/bjc/rgens/parser/RGrammarSet.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/main/java/bjc/rgens/parser/RGrammarSet.java') diff --git a/src/main/java/bjc/rgens/parser/RGrammarSet.java b/src/main/java/bjc/rgens/parser/RGrammarSet.java index 30f08a4..56ed1c8 100755 --- a/src/main/java/bjc/rgens/parser/RGrammarSet.java +++ b/src/main/java/bjc/rgens/parser/RGrammarSet.java @@ -29,17 +29,20 @@ public class RGrammarSet { public Map loadedFrom; /* @NOTE These are replaced by the logging setup */ - public static final boolean PERF = true; - public static final boolean DEBUG = true; + public static final boolean PERF = true; /** Create a new set of randomized grammars. */ public RGrammarSet() { + this(false); + } + + public RGrammarSet(boolean orderExports) { grammars = new HashMap<>(); // @NOTE // Swap which line is commented to toggle ordering of exports - //exportedRules = new TreeMap<>(); - exportedRules = new HashMap<>(); + if (orderExports) exportedRules = new TreeMap<>(); + else exportedRules = new HashMap<>(); loadedFrom = new HashMap<>(); @@ -78,8 +81,7 @@ public class RGrammarSet { exportedRules.put(export.name, export); - if(DEBUG) - debug("%s (%d cases) exported from %s", export.name, export.getCases().getSize(), grammarName); + debug("%s (%d cases) exported from %s", export.name, export.getCases().getSize(), grammarName); } /* Add exports to grammar. */ -- cgit v1.2.3