Package com.dci.intellij.dbn.language.common.element.path

Examples of com.dci.intellij.dbn.language.common.element.path.PathNode


            }
        }

        if (nextPossibleLeafs.size() == 0) {
            LeafElementType elementType = (LeafElementType) element.getElementType();
            PathNode pathNode = new ASTPathNode(element.getNode());
            for (LeafElementType leafElementType : elementType.getNextPossibleLeafs(pathNode, filterSettings)) {
                String leafUniqueKey = getLeafUniqueKey(leafElementType);
                if (leafUniqueKey != null) {
                    nextPossibleLeafs.put(leafUniqueKey, leafElementType);   
                }
View Full Code Here


import com.dci.intellij.dbn.language.common.element.NamedElementType;
import com.dci.intellij.dbn.language.common.element.path.PathNode;

public class ElementTypeUtil {
    public static ElementType getEnclosingElementType(PathNode pathNode, ElementTypeAttribute elementTypeAttribute) {
        PathNode parentNode = pathNode.getParent();
        while (parentNode != null) {
            ElementType elementType = parentNode.getElementType();
            if (elementType.is(elementTypeAttribute)) return elementType;
            parentNode = parentNode.getParent();
        }
        return null;
    }
View Full Code Here

        }
        return null;
    }

    public static NamedElementType getEnclosingNamedElementType(PathNode pathNode) {
        PathNode parentNode = pathNode.getParent();
        while (parentNode != null) {
            ElementType elementType = parentNode.getElementType();
            if (elementType instanceof NamedElementType) return (NamedElementType) elementType;
            parentNode = parentNode.getParent();
        }
        return null;
    }
View Full Code Here

        }
        return false;
    }

    private boolean isFollowedByToken(TokenType tokenType, PathNode node) {
        PathNode parent = node;
        while (parent != null) {
            if (parent.getElementType() instanceof SequenceElementType) {
                SequenceElementType sequenceElementType = (SequenceElementType) parent.getElementType();
                if (sequenceElementType.isPossibleTokenFromIndex(tokenType, parent.getCurrentSiblingIndex() + 1)) {
                    return true;
                }
            }
            // break when statement boundary found
            /*if (parent.getElementType().is(ElementTypeAttribute.STATEMENT)) {
                return false;
            }*/
            parent = parent.getParent();
        }
        return false;
    }
View Full Code Here

        return iterations == 0;
        //return false;
    }

    private int countRecurences(PathNode node) {
        PathNode parent = node;
        int count = 0;
        while(parent != null) {
            if (parent.getElementType() == getElementType()) {
                count++;
            }
            parent = parent.getParent();
        }
        return count;
    }
View Full Code Here

TOP

Related Classes of com.dci.intellij.dbn.language.common.element.path.PathNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.