Examples of ElementType


Examples of com.dci.intellij.dbn.language.common.element.ElementType

            registerLeafInParent(leaf);
        }
    }

    protected void registerLeafInParent(LeafElementType leaf) {
        ElementType parent = getElementType().getParent();
        if (parent != null) {
            parent.getLookupCache().registerLeaf(leaf, getElementType());
        }
    }
View Full Code Here

Examples of com.dci.intellij.dbn.language.common.element.ElementType

    public void registerVirtualObject(DBObjectType objectType) {
        if (virtualObjects == null) {
            virtualObjects = new THashSet<DBObjectType>();
        }
        virtualObjects.add(objectType);
        ElementType parent = getElementType().getParent();
        if (parent != null) {
            parent.getLookupCache().registerVirtualObject(objectType);
        }

    }
View Full Code Here

Examples of com.dci.intellij.dbn.language.common.element.ElementType

     * (named elements do not have parents)
     */
    public Set<TokenType> getNextPossibleTokens() {
        if (nextPossibleTokens == null) {
            nextPossibleTokens = new THashSet<TokenType>();
            ElementType elementType = getElementType();
            ElementType parentElementType = elementType.getParent();
            while (parentElementType != null) {
                if (parentElementType instanceof SequenceElementType) {
                    SequenceElementType sequenceElementType = (SequenceElementType) parentElementType;
                    int elementsCount = sequenceElementType.getElementTypes().length;
                    int index = sequenceElementType.indexOf(elementType, 0);

                    for (int i = index + 1; i < elementsCount; i++) {
                        ElementType next = sequenceElementType.getElementTypes()[i];
                        nextPossibleTokens.addAll(next.getLookupCache().getFirstPossibleTokens());
                        if (!sequenceElementType.isOptional(i)) {
                            parentElementType = null;
                            break;
                        }
                    }
View Full Code Here

Examples of com.dci.intellij.dbn.language.common.element.ElementType

     * (named elements do not have parents)
     */
    public Set<TokenType> getNextRequiredTokens() {
        if (nextRequiredTokens == null) {
            nextRequiredTokens = new THashSet<TokenType>();
            ElementType elementType = getElementType();
            ElementType parentElementType = elementType.getParent();
            while (parentElementType != null) {
                if (parentElementType instanceof SequenceElementType) {
                    SequenceElementType sequence = (SequenceElementType) parentElementType;
                    int elementsCount = sequence.getElementTypes().length;
                    int index = sequence.indexOf(elementType, 0);

                    for (int i = index + 1; i < elementsCount; i++) {
                        if (!sequence.isOptional(i)) {
                            ElementType next = sequence.getElementTypes()[i];
                            nextRequiredTokens.addAll(next.getLookupCache().getFirstPossibleTokens());
                            parentElementType = null;
                            break;
                        }
                    }
                } else if (parentElementType instanceof IterationElementType) {
View Full Code Here

Examples of com.dci.intellij.dbn.language.common.element.ElementType

    }

    public ElementType getPreviousElement(PathNode pathNode) {
        int position = 0;
        while (pathNode != null) {
            ElementType elementType = pathNode.getElementType();
            if (elementType instanceof SequenceElementType) {
                SequenceElementType sequenceElementType = (SequenceElementType) elementType;
                if (position > 0 ) {
                    return sequenceElementType.getElementTypes()[position-1];
                }
View Full Code Here

Examples of com.dci.intellij.dbn.language.common.element.ElementType

        }
        return null;
    }

    public Set<LeafElementType> getAlternativeLeafs(PathNode pathNode) {
        ElementType previousElementType = getPreviousElement(pathNode);
        // FIXME ----------- implement this
        return previousElementType.getLookupCache().getFirstPossibleLeafs();
    }
View Full Code Here

Examples of com.dci.intellij.dbn.language.common.element.ElementType

    public Set<LeafElementType> getNextPossibleLeafs(PathNode pathNode, CodeCompletionFilterSettings filterSettings) {
        Set<LeafElementType> possibleLeafs = new THashSet<LeafElementType>();
        int position = 0;
        while (pathNode != null) {
            ElementType elementType = pathNode.getElementType();

            if (elementType instanceof SequenceElementType) {
                SequenceElementType sequenceElementType = (SequenceElementType) elementType;

                int elementsCount = sequenceElementType.getElementTypes().length;

                for (int i=position+1; i<elementsCount; i++) {
                    ElementType next = sequenceElementType.getElementTypes()[i];
                    possibleLeafs.addAll(next.getLookupCache().getFirstPossibleLeafs());
                    if (!sequenceElementType.isOptional(i)) {
                        pathNode = null;
                        break;
                    }
                }
View Full Code Here

Examples of com.dci.intellij.dbn.language.common.element.ElementType

    public Set<LeafElementType> getNextRequiredLeafs(PathNode pathNode) {
        Set<LeafElementType> requiredLeafs = new THashSet<LeafElementType>();
        int index = 0;
        while (pathNode != null) {
            ElementType elementType = pathNode.getElementType();

            if (elementType instanceof SequenceElementType) {
                SequenceElementType sequenceElementType = (SequenceElementType) elementType;
                int elementsCount = sequenceElementType.getElementTypes().length;

                for (int i=index+1; i<elementsCount; i++) {
                    if (!sequenceElementType.isOptional(i)) {
                        ElementType next = sequenceElementType.getElementTypes()[i];
                        requiredLeafs.addAll(next.getLookupCache().getFirstRequiredLeafs());
                        pathNode = null;
                        break;
                    }
                }
            } else if (elementType instanceof IterationElementType) {
View Full Code Here

Examples of com.dci.intellij.dbn.language.common.element.ElementType

    public String getDebugName() {
        return "token (" + getId() + " - " + getTokenType().getId() + ")";
    }

    public Set<LeafElementType> getNextPossibleLeafs(PathNode pathNode, CodeCompletionFilterSettings filterSettings) {
        ElementType parent = getParent();
        if (isIterationSeparator()) {
            if (parent instanceof IterationElementType) {
                IterationElementType iterationElementType = (IterationElementType) parent;
                /*return codeCompletionSettings.isSmart() ?
                        iterationElementType.getIteratedElementType().getFirstPossibleLeafs() :
View Full Code Here

Examples of com.dci.intellij.dbn.language.common.element.ElementType

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
TOP
Copyright © 2018 www.massapi.com. 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.