summaryrefslogtreecommitdiff
path: root/JPratt/src/main/java/bjc/pratt/ParserContext.java
diff options
context:
space:
mode:
authorStudent <student@Administrators-iMac-2.local>2017-04-12 11:05:57 -0400
committerStudent <student@Administrators-iMac-2.local>2017-04-12 11:05:57 -0400
commit22c356cd411cf0fcc18d548291af26bc7588a3aa (patch)
tree4f24fdda182b358ca96aed2249bb4e8a19994747 /JPratt/src/main/java/bjc/pratt/ParserContext.java
parent2dc1b5dd145ab0e2b3e3df67f967a9c07ed6d303 (diff)
parentf394306a4b65a3328551f9f6b8d4abff8bfd5b27 (diff)
Merge branch 'master' of https://github.com/bculkin2442/JPratt.git
Diffstat (limited to 'JPratt/src/main/java/bjc/pratt/ParserContext.java')
-rw-r--r--JPratt/src/main/java/bjc/pratt/ParserContext.java39
1 files changed, 24 insertions, 15 deletions
diff --git a/JPratt/src/main/java/bjc/pratt/ParserContext.java b/JPratt/src/main/java/bjc/pratt/ParserContext.java
index f5e22ba..1e0b054 100644
--- a/JPratt/src/main/java/bjc/pratt/ParserContext.java
+++ b/JPratt/src/main/java/bjc/pratt/ParserContext.java
@@ -1,15 +1,17 @@
package bjc.pratt;
+import bjc.pratt.tokens.TokenStream;
+
/**
* Represents the contextual state passed to a command.
- *
+ *
* @author EVE
*
* @param <K>
* The key type of the tokens.
* @param <V>
* The value type of the tokens.
- *
+ *
* @param <C>
* The state type of the parser.
*/
@@ -17,31 +19,38 @@ public class ParserContext<K, V, C> {
/**
* The source of tokens.
*/
- public TokenStream<K, V> tokens;
+ public TokenStream<K, V> tokens;
+
/**
* The parser for sub-expressions.
*/
- public PrattParser<K, V, C> parse;
+ public PrattParser<K, V, C> parse;
+
/**
* The state of the parser.
*/
- public C state;
+ public C state;
+
+ /**
+ * The initial command for the current expression.
+ */
+ public K initial;
/**
* Create a new parser context.
- *
- * @param tokens
+ *
+ * @param tokns
* The source of tokens.
- *
- * @param parse
+ *
+ * @param prse
* The parser to call for sub expressions.
- *
- * @param state
+ *
+ * @param stte
* Any state needing to be kept during parsing.
*/
- public ParserContext(TokenStream<K, V> tokens, PrattParser<K, V, C> parse, C state) {
- this.tokens = tokens;
- this.parse = parse;
- this.state = state;
+ public ParserContext(final TokenStream<K, V> tokns, final PrattParser<K, V, C> prse, final C stte) {
+ tokens = tokns;
+ parse = prse;
+ state = stte;
}
} \ No newline at end of file