P
P
Pavel Talaiko2018-11-21 10:14:48
Java
Pavel Talaiko, 2018-11-21 10:14:48

Is there a ready-made parser query string solution in java?

Hello toasters.
The question is. It is necessary to parse lines of the form:
value = key OR (value2 = key3 AND value3=key3)
Is there a ready-made solution for parsing such requests in essence?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Developer, 2018-11-21
@samodum

There is such a solution.
As an option - write your own grammar (it's simple here) and feed it into ANTLR.
At the output, we get a parser file in the desired language, which can already be used.
But ANTLR is more beneficial to use when grammars are complex, for such a simple example it may be overkill

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question