001package gudusoft.gsqlparser.dlineage.statistics;
002
003import gudusoft.gsqlparser.nodes.TParseTreeVisitor;
004import gudusoft.gsqlparser.nodes.TFunctionCall;
005
006/**
007 * 窗口函数访问者
008 */
009public class WindowFunctionVisitor extends TParseTreeVisitor {
010    private int windowFunctionCount = 0;
011
012    public void preVisit(TFunctionCall node) {
013        if (node.getWindowDef() != null) {
014            windowFunctionCount++;
015        }
016    }
017
018    public int getWindowFunctionCount() {
019        return windowFunctionCount;
020    }
021    
022    public void reset() {
023        windowFunctionCount = 0;
024    }
025}