From ffbdf8a36c82f324ee5806e763045a57d8791198 Mon Sep 17 00:00:00 2001 From: Terence Parr Date: Sun, 18 Nov 2012 15:04:42 -0800 Subject: [PATCH] tweak to compile. strange --- tool/playground/T.g | 6 +++--- tool/src/org/antlr/v4/tool/GrammarTransformPipeline.java | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tool/playground/T.g b/tool/playground/T.g index 819d11e52..1a3aba177 100644 --- a/tool/playground/T.g +++ b/tool/playground/T.g @@ -1,6 +1,6 @@ grammar T; -s : rule ; +s : R ; + +R : 'x' EOF; -rule : A # X - ; diff --git a/tool/src/org/antlr/v4/tool/GrammarTransformPipeline.java b/tool/src/org/antlr/v4/tool/GrammarTransformPipeline.java index dbceaa87e..83b4c56f1 100644 --- a/tool/src/org/antlr/v4/tool/GrammarTransformPipeline.java +++ b/tool/src/org/antlr/v4/tool/GrammarTransformPipeline.java @@ -279,7 +279,7 @@ public class GrammarTransformPipeline { GrammarRootAST combinedAST = combinedGrammar.ast; //tool.log("grammar", "before="+combinedAST.toStringTree()); GrammarASTAdaptor adaptor = new GrammarASTAdaptor(combinedAST.token.getInputStream()); - GrammarAST[] elements = combinedAST.getChildren().toArray(new GrammarAST[0]); + GrammarAST[] elements = (GrammarAST[])combinedAST.getChildren().toArray(new GrammarAST[0]); // MAKE A GRAMMAR ROOT and ID String lexerName = combinedAST.getChild(0).getText()+"Lexer"; @@ -295,7 +295,7 @@ public class GrammarTransformPipeline { if ( optionsRoot!=null ) { GrammarAST lexerOptionsRoot = (GrammarAST)adaptor.dupNode(optionsRoot); lexerAST.addChild(lexerOptionsRoot); - GrammarAST[] options = optionsRoot.getChildren().toArray(new GrammarAST[0]); + GrammarAST[] options = (GrammarAST[])optionsRoot.getChildren().toArray(new GrammarAST[0]); for (GrammarAST o : options) { String optionName = o.getChild(0).getText(); if ( Grammar.lexerOptions.contains(optionName) &&