P
puzzlecracker
Hi group,
I am implementing a fairly simple and straightforward text-search (I
display each line that contains required pattern ) that supports
Boolean queries in the following format:
str1 AND str2 NOT str3 - where not is a unary operation thus the
following would be equivalent to str1 AND str ANDNOT str3 by default
unless a user specifies otherwise....
Additionally, It is left-associative;
I would also like to have parenthesis as well: (str1 AND (str2 OR
str3))
That is it....
Should I write a parser for that followed by walking the AST (abstract
syntax tree) - javacc or antlar? - or would java regular expressions
suffice? it should be fast, whereas java regex is known to be slow....
Any suggestions, examples, references would be highly appreciated.
Thx
I am implementing a fairly simple and straightforward text-search (I
display each line that contains required pattern ) that supports
Boolean queries in the following format:
str1 AND str2 NOT str3 - where not is a unary operation thus the
following would be equivalent to str1 AND str ANDNOT str3 by default
unless a user specifies otherwise....
Additionally, It is left-associative;
I would also like to have parenthesis as well: (str1 AND (str2 OR
str3))
That is it....
Should I write a parser for that followed by walking the AST (abstract
syntax tree) - javacc or antlar? - or would java regular expressions
suffice? it should be fast, whereas java regex is known to be slow....
Any suggestions, examples, references would be highly appreciated.
Thx