lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mario Alejandro M." <>
Subject Troubling with StandarTokenizer/QueryParser code generate in JavaCC
Date Sat, 16 Apr 2005 22:09:08 GMT
I'm porting Lucene to Delphi. And is going great, I only need to pass 10 
test case to get the indexing code... however I'm stuck with 
StandarTokenizer and QueryParser, all the JavaCC generated code.

Port it prove dificult, the code is machine generate, and I don't get it. I 
can spend hours porting it voodo style! but that is not a productive way. 
Also if this code is changed later then I need to recode it.

So, how I can work on this?

- Is possible output from JavaCC Delphi/Pascal code?

I think if this is possible, maybe is the best way. However I need a 
ready-to-go solution, I don't have experiencia in Java.

- Generate the parser in other tool. I think in CoCor for Delphi ( If must other, please tell me

The truth is, i don't know anything about generate parsers/compilers, I can 
do some basic stuff with regular expressions but this is something never 
before I need to do. 

However playing a bit i *think* I can go this way. But, this mean that this 
code is work in isolation. In the other hand, I can control it more and the 
main thing, I need something I can understand. 

If this is a good way, how proced? Today, i get this:

COMPILER LuceneQuery



digit = '1234567890' . 
special = '"' + "%&'()*+,-./:;<=>?|" .
letter = CHR(33)..CHR(255) - special - digit.

term DESCRIPTION "term"
= letter { letter | digit } .

fieldterm = letter ":" letter .

phrase = '"' letter { letter | digit } '"' .

integer = digit { digit } . 



LuceneQuery = (Query) . 

Query = (QueryTermList). 

QueryTerm = (term | phrase | fieldterm).

GroupedQueryTerm = OpenParens QueryTermList { QueryTermList } CloseParens .

ValidQueryTerm = QueryTerm | GroupedQueryTerm .

QueryTermList = ValidQueryTerm 
{ QueryUnion
ValidQueryTerm } .

QueryUnion = ("AND" | "OR" ) .

OpenParens = "(" . 

CloseParens = WEAK ")" . 

END LuceneQuery .

But this is based in my understanding of the query parser and not in the 
actual grammar of JavaCC. Also, I don't understand at all the rules of 

- Get pain :(

Do voodo with the code and hope it works...

Thanks for your suggestions..

Mario Alejandro Montoya
MCP <>
!Obtenga su sitio Web dinĂ¡mico!
The open source indexing engine for Delphi!

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message