aboutsummaryrefslogtreecommitdiffstats
path: root/container-search/src/main/java/com/yahoo/search/query/parser/Parser.java
blob: 3822b9b67d8a56717376da2dca0fd631975216dc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.query.parser;

import com.yahoo.search.query.QueryTree;

/**
 * Defines the interface of a query parser. To construct an instance of this class, use the {@link ParserFactory}.
 *
 * @author <a href="mailto:simon@yahoo-inc.com">Simon Thoresen</a>
 */
public interface Parser {

    /**
     * Parser the given {@link Parsable}, and returns a corresponding
     * {@link QueryTree}. If parsing fails without an exception, the contained
     * root will be an instance of {@link com.yahoo.prelude.query.NullItem}.
     *
     * @param query
     *            the Parsable to parse
     * @return the parsed QueryTree, never null
     */
    QueryTree parse(Parsable query);

}