Return-Path: X-Original-To: apmail-lucene-dev-archive@www.apache.org Delivered-To: apmail-lucene-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E5F40181A9 for ; Wed, 5 Aug 2015 09:33:11 +0000 (UTC) Received: (qmail 3770 invoked by uid 500); 5 Aug 2015 09:33:04 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 3709 invoked by uid 500); 5 Aug 2015 09:33:04 -0000 Mailing-List: contact dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list dev@lucene.apache.org Received: (qmail 3696 invoked by uid 99); 5 Aug 2015 09:33:04 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Aug 2015 09:33:04 +0000 Date: Wed, 5 Aug 2015 09:33:04 +0000 (UTC) From: "Uwe Schindler (JIRA)" To: dev@lucene.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (LUCENE-6417) Upgrade ANTLR to version 4.5 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/LUCENE-6417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14655068#comment-14655068 ] Uwe Schindler commented on LUCENE-6417: --------------------------------------- Hi, there is actually a solution without any additional regexes. The main problem are not the implementation classes. They can stay public, because the outer class is pkg private. The problem are more interfaces and their implementations in public classes. The problem here is the following: JavascriptCompiter is public API but it implements an interface using pkg private classes in method signatures. This causes issues, because all methods implementing an interface must be public :-( Because JavascriptCompiter is public those methods get visible to everybody, but their signatures use pkg-protected (sub-)classes. This breaks visibility and Javadocs linting fails (404 not found errors). The solution is the following: - make JavascriptErrorHandlingLexer, JavascriptParserErrorStrategy pkg private (its impl detail) - make JavascriptVisitor interface pkg-private (this one is the main issue) - the problem is now that JavaScript compiler implement JavascriptVisitor, and therefore all implemented methods get public (which is bad). The workaround is the following: Make the actual visitor implementation not part of public API, instead create the visitor (that extends JavascriptBaseVisitor) inside JavascriptCompiler as anonymous, private instance and call the visit method on it, but not implement the interface method directly in the top-level class. Because it is anonymous inner class it has access to all methods/fields, but the implemented interface keeps private. You can move most methods handling the visiting process into the anonymous inner class. On top-level you just have the compiler (as before). I have not much time today to implement this, but this might work. [~jdconradson]: If you work on this, can you use my patch as base? I already solved the license issues, so precommit passes, except the visibility problems. Finally, the VariableContext should be pkg-private, too - it was made public in some earlier commit, but it does not need to be public at all (I think?). > Upgrade ANTLR to version 4.5 > ---------------------------- > > Key: LUCENE-6417 > URL: https://issues.apache.org/jira/browse/LUCENE-6417 > Project: Lucene - Core > Issue Type: Improvement > Reporter: Jack Conradson > Assignee: Uwe Schindler > Attachments: LUCENE-6471.patch, LUCENE-6471.patch, LUCENE-6471.patch > > > I would like to upgrade ANTLR from 3.5 to 4.5. This version adds several features that will improve the existing grammars. The main improvement would be the allowance of left-hand recursion in grammar rules which will reduce the number of rules significantly for expressions. > This change will require some code refactoring to the existing expressions work. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org