From 9b9ce0c3123d70b9e839084aade4f37eb08e328d Mon Sep 17 00:00:00 2001 From: "Benjamin J. Culkin" Date: Mon, 4 Jun 2018 21:13:50 -0300 Subject: Rule variables pt. 1 Add the capability to store regular/exhaustible rule variables --- src/main/java/bjc/rgens/parser/GenerationState.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/main/java/bjc/rgens/parser/GenerationState.java') diff --git a/src/main/java/bjc/rgens/parser/GenerationState.java b/src/main/java/bjc/rgens/parser/GenerationState.java index 7ab55bf..78fce96 100644 --- a/src/main/java/bjc/rgens/parser/GenerationState.java +++ b/src/main/java/bjc/rgens/parser/GenerationState.java @@ -33,6 +33,7 @@ public class GenerationState { */ /** The current set of variables. */ public Map vars; + public Map rlVars; /** * Create a new generation state. @@ -46,10 +47,11 @@ public class GenerationState { * @param vs * The variables to use. */ - public GenerationState(StringBuilder cont, Random rand, Map vs, RGrammar gram) { + public GenerationState(StringBuilder cont, Random rand, Map vs, Map rvs, RGrammar gram) { contents = cont; - rnd = rand; - vars = vs; + rnd = rand; + vars = vs; + rlVars = rvs; this.gram = gram; @@ -66,6 +68,6 @@ public class GenerationState { } public GenerationState newBuf() { - return new GenerationState(new StringBuilder(), rnd, vars, gram); + return new GenerationState(new StringBuilder(), rnd, vars, rlVars, gram); } } -- cgit v1.2.3