Package com.strobel.decompiler.languages

Examples of com.strobel.decompiler.languages.TextLocation


    public final boolean contains(final TextLocation location) {
        if (location == null || location.isEmpty()) {
            return false;
        }

        final TextLocation startLocation = getStartLocation();
        final TextLocation endLocation = getEndLocation();

        return startLocation != null &&
               endLocation != null &&
               location.compareTo(startLocation) >= 0 &&
               location.compareTo(endLocation) < 0;
View Full Code Here


               location.compareTo(startLocation) >= 0 &&
               location.compareTo(endLocation) < 0;
    }

    public final boolean isInside(final int line, final int column) {
        return isInside(new TextLocation(line, column));
    }
View Full Code Here

    public final boolean isInside(final TextLocation location) {
        if (location == null || location.isEmpty()) {
            return false;
        }

        final TextLocation startLocation = getStartLocation();
        final TextLocation endLocation = getEndLocation();

        return startLocation != null &&
               endLocation != null &&
               location.compareTo(startLocation) >= 0 &&
               location.compareTo(endLocation) <= 0;
View Full Code Here

    public void setStartLocation(final TextLocation startLocation) {
        _startLocation = startLocation;
    }

    public TextLocation getEndLocation() {
        return new TextLocation(_startLocation.line(), _startLocation.column() + getTokenLength());
    }
View Full Code Here

        this(TextLocation.EMPTY);
    }

    protected NewLineNode(final TextLocation startLocation) {
        _startLocation = startLocation != null ? startLocation : TextLocation.EMPTY;
        _endLocation = new TextLocation(_startLocation.line() + 1, 1);
    }
View Full Code Here

    }

    public ThisReferenceExpression(final int offset, final TextLocation startLocation) {
        super( offset);
        _startLocation = VerifyArgument.notNull(startLocation, "startLocation");
        _endLocation = new TextLocation(startLocation.line(), startLocation.column() + THIS_TEXT.length());
    }
View Full Code Here

        setChildByRole(Roles.TARGET_EXPRESSION, value);
    }

    public final void setStartLocation(final TextLocation startLocation) {
        _startLocation = VerifyArgument.notNull(startLocation, "startLocation");
        _endLocation = new TextLocation(startLocation.line(), startLocation.column() + THIS_TEXT.length());
    }
View Full Code Here

        return null;
    }

    @Override
    public Void visitJavaTokenNode(final JavaTokenNode node, final Void ignored) {
        node.setStartLocation(new TextLocation(output.getRow(), output.getColumn()));
        if (node instanceof JavaModifierToken) {
            final JavaModifierToken modifierToken = (JavaModifierToken) node;
            startNode(modifierToken);
            writeKeyword(JavaModifierToken.getModifierName(modifierToken.getModifier()));
            endNode(modifierToken);
View Full Code Here

        return null;
    }

    @Override
    public Void visitIdentifier(final Identifier node, final Void ignored) {
        node.setStartLocation(new TextLocation(output.getRow(), output.getColumn()));
        startNode(node);
        writeIdentifier(node.getName());
        endNode(node);
        return null;
    }
View Full Code Here

        return null;
    }

    @Override
    public Void visitNullReferenceExpression(final NullReferenceExpression node, final Void ignored) {
        node.setStartLocation(new TextLocation(output.getRow(), output.getColumn()));
        startNode(node);
        writeKeyword("null", node.getRole());
        endNode(node);
        return null;
    }
View Full Code Here

TOP

Related Classes of com.strobel.decompiler.languages.TextLocation

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.