v4 tool: A couple simple generics

[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9270]
This commit is contained in:
sharwell 2011-11-10 07:52:30 -08:00
parent 3ca6ab034d
commit f9c364db1f
2 changed files with 14 additions and 14 deletions

View File

@ -70,8 +70,8 @@ import java.util.*;
* TODO: 1 action per lex rule * TODO: 1 action per lex rule
*/ */
public class BasicSemanticChecks extends GrammarTreeVisitor { public class BasicSemanticChecks extends GrammarTreeVisitor {
public static final Set legalLexerOptions = public static final Set<String> legalLexerOptions =
new HashSet() { new HashSet<String>() {
{ {
add("language"); add("tokenVocab"); add("language"); add("tokenVocab");
add("TokenLabelType"); add("TokenLabelType");
@ -83,8 +83,8 @@ public class BasicSemanticChecks extends GrammarTreeVisitor {
} }
}; };
public static final Set legalParserOptions = public static final Set<String> legalParserOptions =
new HashSet() { new HashSet<String>() {
{ {
add("language"); add("tokenVocab"); add("language"); add("tokenVocab");
add("output"); add("rewrite"); add("ASTLabelType"); add("output"); add("rewrite"); add("ASTLabelType");
@ -96,8 +96,8 @@ public class BasicSemanticChecks extends GrammarTreeVisitor {
} }
}; };
public static final Set legalTreeParserOptions = public static final Set<String> legalTreeParserOptions =
new HashSet() { new HashSet<String>() {
{ {
add("language"); add("tokenVocab"); add("language"); add("tokenVocab");
add("output"); add("rewrite"); add("ASTLabelType"); add("output"); add("rewrite"); add("ASTLabelType");
@ -110,20 +110,20 @@ public class BasicSemanticChecks extends GrammarTreeVisitor {
} }
}; };
public static final Set legalRuleOptions = public static final Set<String> legalRuleOptions =
new HashSet() { new HashSet<String>() {
{ {
add("k"); add("greedy"); add("memoize"); add("k"); add("greedy"); add("memoize");
add("backtrack"); add("strategy"); add("backtrack"); add("strategy");
} }
}; };
public static final Set legalBlockOptions = public static final Set<String> legalBlockOptions =
new HashSet() {{add("k"); add("greedy"); add("backtrack"); add("memoize");}}; new HashSet<String>() {{add("k"); add("greedy"); add("backtrack"); add("memoize");}};
/** Legal options for terminal refs like ID<node=MyVarNode> */ /** Legal options for terminal refs like ID<node=MyVarNode> */
public static final Set legalTokenOptions = public static final Set<String> legalTokenOptions =
new HashSet() { new HashSet<String>() {
{ {
add(TerminalAST.defaultTokenOption); add(TerminalAST.defaultTokenOption);
add("associativity"); add("associativity");

View File

@ -37,8 +37,8 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
public class GrammarRootAST extends GrammarASTWithOptions { public class GrammarRootAST extends GrammarASTWithOptions {
public static final Map defaultOptions = public static final Map<String, String> defaultOptions =
new HashMap() { new HashMap<String, String>() {
{ {
put("language","Java"); put("language","Java");
} }