001package gudusoft.gsqlparser.nodes.mdx;
002
003import gudusoft.gsqlparser.TSourceToken;
004import gudusoft.gsqlparser.nodes.TDummy;
005import gudusoft.gsqlparser.nodes.TPTNodeList;
006import gudusoft.gsqlparser.nodes.TParseTreeVisitor;
007
008/**
009 * Query axis clause in select list
010 */
011public class TMdxAxisNode extends TMdxExpNode {
012
013    private TMdxNonEmptyNode nonEmptyNode;
014    private TPTNodeList<TMdxIdentifierNode> dimensionProperties;
015    private TMdxExpNode expNode;
016    private TSourceToken Name_OR_Number;
017
018    public EMdxDataType getMdxDataType() {
019        return EMdxDataType.Unknown;
020    }
021
022    /**
023     * list of dimension property clause
024     * @return list of dimension property clause
025     */
026    public TPTNodeList<TMdxIdentifierNode> getDimensionProperties() {
027        return dimensionProperties;
028    }
029
030    /**
031     * A valid Multidimensional Expressions (MDX) expression to populate the axis
032     *
033     * @return A valid Multidimensional Expressions
034     */
035    public TMdxExpNode getExpNode() {
036        return expNode;
037    }
038
039    /**
040     * Depreciated since v1.9.8.0, replaced by {@link #getAxis()}
041     *
042     * @return axis
043     */
044    public TSourceToken getName_OR_Number() {
045        return Name_OR_Number;
046    }
047
048    public TMdxNonEmptyNode getNonEmptyNode() {
049        return nonEmptyNode;
050    }
051    private TMdxAxis Axis;
052
053    /**
054     * the name of the axis this axis expression is populating
055     *
056     * @return the name of the axis this axis expression is populating
057     */
058    public TMdxAxis getAxis() {
059        return Axis;
060    }
061
062    public void init(Object arg1,Object arg2,Object arg3,Object arg4){
063        nonEmptyNode = (TMdxNonEmptyNode)arg1;
064        expNode = (TMdxExpNode)arg2;
065        if (arg3 != null){
066            if (arg3 instanceof TDummy){
067                dimensionProperties = (TPTNodeList<TMdxIdentifierNode>) ((TDummy)arg3).node1;
068            }
069        }
070
071        //Name_OR_Number = (TSourceToken)arg4;
072        Axis = (TMdxAxis)arg4;
073    }
074
075    public void accept(TParseTreeVisitor v){
076        v.preVisit(this);
077        //expNode.accept(v);
078        v.postVisit(this);
079    }
080
081    public void acceptChildren(TParseTreeVisitor v){
082        v.preVisit(this);
083        expNode.accept(v);
084        v.postVisit(this);
085    }
086
087}