001    /*
002    // $Id: //open/mondrian/src/main/mondrian/olap/FunTable.java#15 $
003    // This software is subject to the terms of the Common Public License
004    // Agreement, available at the following URL:
005    // http://www.opensource.org/licenses/cpl.html.
006    // Copyright (C) 2002-2002 Kana Software, Inc.
007    // Copyright (C) 2002-2006 Julian Hyde and others
008    // All Rights Reserved.
009    // You must accept the terms of that agreement to use this software.
010    //
011    // jhyde, 3 March, 2002
012     */
013    package mondrian.olap;
014    import mondrian.mdx.UnresolvedFunCall;
015    import mondrian.olap.fun.Resolver;
016    import mondrian.olap.fun.FunInfo;
017    
018    import java.util.*;
019    
020    /**
021     * List of all MDX functions.
022     *
023     * A function table can resolve a function call, using a particular
024     * {@link Syntax} and set of arguments, to a
025     * function definition ({@link FunDef}).
026     */
027    public interface FunTable {
028        /**
029         * Resolves a function call to a particular function. If the function is
030         * overloaded, returns as precise a match to the argument types as
031         * possible.
032         */
033        FunDef getDef(
034                Exp[] args, Validator validator, String funName, Syntax syntax);
035    
036        /**
037         * Returns whether a string is a reserved word.
038         */
039        boolean isReserved(String s);
040    
041        /**
042         * Returns whether a string is a property-style (postfix)
043         * operator. This is used during parsing to disambiguate
044         * functions from unquoted member names.
045         */
046        boolean isProperty(String s);
047    
048        /**
049         * Returns whether the <code>k</code>th argument to a function call
050         * has to be an expression.
051         */
052        boolean requiresExpression(
053                UnresolvedFunCall funCall,
054                int k,
055                Validator validator);
056    
057        /**
058         * Returns a list of words ({@link String}) which may not be used as
059         * identifiers.
060         */
061        List<String> getReservedWords();
062    
063        /**
064         * Returns a list of {@link mondrian.olap.fun.Resolver} objects.
065         */
066        List<Resolver> getResolvers();
067    
068        /**
069         * Returns a list of {@link mondrian.olap.fun.FunInfo} objects.
070         */
071        List<FunInfo> getFunInfoList();
072    
073    }
074    
075    // End FunTable.java