forked from jasder/antlr
Use isEmpty() instead of size()==0, specify generic arguments
This commit is contained in:
parent
683b915507
commit
96654531b7
|
@ -758,7 +758,7 @@ public class Grammar implements AttributeResolver {
|
||||||
Map<String,String> lexerRuleToStringLiteral = new HashMap<String,String>();
|
Map<String,String> lexerRuleToStringLiteral = new HashMap<String,String>();
|
||||||
|
|
||||||
List<GrammarAST> ruleNodes = ast.getNodesWithType(ANTLRParser.RULE);
|
List<GrammarAST> ruleNodes = ast.getNodesWithType(ANTLRParser.RULE);
|
||||||
if ( ruleNodes==null || ruleNodes.size()==0 ) return null;
|
if ( ruleNodes==null || ruleNodes.isEmpty() ) return null;
|
||||||
|
|
||||||
for (GrammarAST r : ruleNodes) {
|
for (GrammarAST r : ruleNodes) {
|
||||||
//tool.log("grammar", r.toStringTree());
|
//tool.log("grammar", r.toStringTree());
|
||||||
|
@ -782,7 +782,7 @@ public class Grammar implements AttributeResolver {
|
||||||
TreeWizard wiz,
|
TreeWizard wiz,
|
||||||
Map<String, String> lexerRuleToStringLiteral)
|
Map<String, String> lexerRuleToStringLiteral)
|
||||||
{
|
{
|
||||||
HashMap nodes = new HashMap();
|
HashMap<String, Object> nodes = new HashMap<String, Object>();
|
||||||
if ( wiz.parse(r, pattern, nodes) ) {
|
if ( wiz.parse(r, pattern, nodes) ) {
|
||||||
GrammarAST litNode = (GrammarAST)nodes.get("lit");
|
GrammarAST litNode = (GrammarAST)nodes.get("lit");
|
||||||
GrammarAST nameNode = (GrammarAST)nodes.get("name");
|
GrammarAST nameNode = (GrammarAST)nodes.get("name");
|
||||||
|
|
Loading…
Reference in New Issue