diff options
| author | bjculkin <bjculkin@mix.wvu.edu> | 2018-02-15 15:25:09 -0500 |
|---|---|---|
| committer | bjculkin <bjculkin@mix.wvu.edu> | 2018-02-15 15:25:09 -0500 |
| commit | 5028ad9a1faad0e363d017f18363e8062ba59871 (patch) | |
| tree | 80df30dc24a2cd79abf7533b98fcfcd28b1f4fee /JPratt/src/main/java/bjc/pratt/tokens | |
| parent | 1112bb1b44bb3aabe439a2b9f88a51a9c1e435de (diff) | |
Formatting and things
Diffstat (limited to 'JPratt/src/main/java/bjc/pratt/tokens')
4 files changed, 26 insertions, 26 deletions
diff --git a/JPratt/src/main/java/bjc/pratt/tokens/StringToken.java b/JPratt/src/main/java/bjc/pratt/tokens/StringToken.java index ff47667..4f9b73a 100644 --- a/JPratt/src/main/java/bjc/pratt/tokens/StringToken.java +++ b/JPratt/src/main/java/bjc/pratt/tokens/StringToken.java @@ -14,10 +14,10 @@ public class StringToken implements Token<String, String> { * Create a new string token. * * @param ky - * The key for the token. + * The key for the token. * * @param vl - * The value for the token. + * The value for the token. */ public StringToken(final String ky, final String vl) { key = ky; @@ -47,19 +47,19 @@ public class StringToken implements Token<String, String> { @Override public boolean equals(final Object obj) { - if (this == obj) return true; - if (obj == null) return false; - if (!(obj instanceof StringToken)) return false; + if(this == obj) return true; + if(obj == null) return false; + if(!(obj instanceof StringToken)) return false; final StringToken other = (StringToken) obj; - if (key == null) { - if (other.key != null) return false; - } else if (!key.equals(other.key)) return false; + if(key == null) { + if(other.key != null) return false; + } else if(!key.equals(other.key)) return false; - if (val == null) { - if (other.val != null) return false; - } else if (!val.equals(other.val)) return false; + if(val == null) { + if(other.val != null) return false; + } else if(!val.equals(other.val)) return false; return true; } @@ -73,7 +73,7 @@ public class StringToken implements Token<String, String> { * Create a new literal token (has same key/value). * * @param val - * The value for the literal token. + * The value for the literal token. * * @return A literal token with that key. */ diff --git a/JPratt/src/main/java/bjc/pratt/tokens/StringTokenStream.java b/JPratt/src/main/java/bjc/pratt/tokens/StringTokenStream.java index 07e1827..044d19a 100644 --- a/JPratt/src/main/java/bjc/pratt/tokens/StringTokenStream.java +++ b/JPratt/src/main/java/bjc/pratt/tokens/StringTokenStream.java @@ -22,7 +22,7 @@ public class StringTokenStream extends TokenStream<String, String> { * Create a new token stream from a iterator. * * @param itr - * The iterator to use. + * The iterator to use. * */ public StringTokenStream(final Iterator<Token<String, String>> itr) { @@ -37,7 +37,7 @@ public class StringTokenStream extends TokenStream<String, String> { @Override public Token<String, String> next() { - if (iter.hasNext()) { + if(iter.hasNext()) { curr = iter.next(); } else { curr = litToken("(end)"); diff --git a/JPratt/src/main/java/bjc/pratt/tokens/Token.java b/JPratt/src/main/java/bjc/pratt/tokens/Token.java index b07d2e1..7de4ada 100644 --- a/JPratt/src/main/java/bjc/pratt/tokens/Token.java +++ b/JPratt/src/main/java/bjc/pratt/tokens/Token.java @@ -6,11 +6,11 @@ package bjc.pratt.tokens; * @author EVE * * @param <K> - * The key type of this token. Represents the type of the token. + * The key type of this token. Represents the type of the token. * * @param <V> - * The value type of this token. Represents any additional data - * for the token. + * The value type of this token. Represents any additional data for the + * token. * */ public interface Token<K, V> { diff --git a/JPratt/src/main/java/bjc/pratt/tokens/TokenStream.java b/JPratt/src/main/java/bjc/pratt/tokens/TokenStream.java index a5febcc..1c550de 100644 --- a/JPratt/src/main/java/bjc/pratt/tokens/TokenStream.java +++ b/JPratt/src/main/java/bjc/pratt/tokens/TokenStream.java @@ -14,10 +14,10 @@ import bjc.utils.parserutils.ParserException; * @author EVE * * @param <K> - * The key type of the token. + * The key type of the token. * * @param <V> - * The value type of the token. + * The value type of the token. */ public abstract class TokenStream<K, V> implements Iterator<Token<K, V>> { /** @@ -33,7 +33,7 @@ public abstract class TokenStream<K, V> implements Iterator<Token<K, V>> { * Create a new exception with the specified message. * * @param msg - * The message of the exception. + * The message of the exception. */ public ExpectationException(final String msg) { super(msg); @@ -58,15 +58,15 @@ public abstract class TokenStream<K, V> implements Iterator<Token<K, V>> { * set of types, and then consuming it. * * @param expectedKeys - * The expected values + * The expected values * * @throws ExpectationException - * If the token is not one of the expected types. + * If the token is not one of the expected types. */ public void expect(final Set<K> expectedKeys) throws ExpectationException { final K curKey = current().getKey(); - if (!expectedKeys.contains(curKey)) { + if(!expectedKeys.contains(curKey)) { final String expectedList = StringUtils.toEnglishList(expectedKeys.toArray(), false); throw new ExpectationException("One of '" + expectedList + "' was expected, not " + curKey); @@ -80,10 +80,10 @@ public abstract class TokenStream<K, V> implements Iterator<Token<K, V>> { * set of types, and then consuming it. * * @param expectedKeys - * The expected values + * The expected values * * @throws ExpectationException - * If the token is not one of the expected types. + * If the token is not one of the expected types. */ @SafeVarargs public final void expect(final K... expectedKeys) throws ExpectationException { @@ -94,7 +94,7 @@ public abstract class TokenStream<K, V> implements Iterator<Token<K, V>> { * Check whether the head token is a certain type. * * @param val - * The type to check for. + * The type to check for. * * @return Whether or not the head token is of that type. */ |
