I’ve got task to do and I even dont know how to start. I need to implement AST parser for queries like that one:
((book where publish_date > 2000).author)
In main method it should look like this:
Expression ex = new DotExpression(
new WhereExpression(
new NameExpression("book"),
new NameExpression("publish_date") > 2000
),
new NameExpression("author"));
ex.accept(new ASTVisitor());
That’s only example how to call it. Any advices how to start? Some code examples would be great.
A factory for all those classes would be fine:
Usage