You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by "Shad Storhaug (Jira)" <ji...@apache.org> on 2019/10/10 19:31:00 UTC

[jira] [Updated] (LUCENENET-620) Automate Generation of QueryParser to C#

     [ https://issues.apache.org/jira/browse/LUCENENET-620?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shad Storhaug updated LUCENENET-620:
------------------------------------
    Remaining Estimate: 120h
     Original Estimate: 120h

> Automate Generation of QueryParser to C#
> ----------------------------------------
>
>                 Key: LUCENENET-620
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-620
>             Project: Lucene.Net
>          Issue Type: Wish
>          Components: Lucene.Net.QueryParser
>            Reporter: Shad Storhaug
>            Priority: Minor
>              Labels: up-for-grabs
>   Original Estimate: 120h
>  Remaining Estimate: 120h
>
> The Lucene team is using a tool called [javacc|https://github.com/javacc/javacc] to generate the main business logic behind the query parsers. If we had a similar tool it could help:
> * Speed up the process of porting/upgrading QueryParser
> * Reduce the number of bugs in these modules caused by doing it manually
> * Most importantly, QueryParser could potentially be generated without using exceptions for control flow
> The javacc tool uses a configuration file as input and creates java code as output. Here are some examples of those configuration files:
> * https://github.com/apache/lucene-solr/blob/releases/lucene-solr/4.8.1/lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParser.jj
> * https://github.com/apache/lucene-solr/blob/releases/lucene-solr/4.8.1/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/QueryParser.jj
> This has not been fully researched, but there are at least 2 potential ways we could approach this:
> # Find a similar tool to javacc in .NET that supports similar options that were used in javacc, and create a converter tool to change the javacc configuration into a configuration that the .NET tool supports.
> # Do a direct port of javacc to C#, and fix its logic to use a more efficient control flow mechanism than exceptions (perhaps {{goto}} would be the most direct replacement).
> It seems [according to this document|https://dzone.com/articles/antlr-and-javacc-parser-generators] that using a port of javacc should be our first choice because of the performance benchmarks of the resultant code. And certainly that would eliminate the risk of having a .NET tool not support an option that we need either now or for some future version of Lucene.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)