Examples of GoExpr


Examples of ro.redeul.google.go.lang.psi.expressions.GoExpr

        return (GoExpr) secondStop;
    }

    @Override
    public GoExpr getCapacity() {
        GoExpr expressions[] = findChildrenByClass(GoExpr.class);

        PsiElement firstColon = expressions[0].getNextSibling();

        while (firstColon != null && firstColon.getNode().getElementType() != GoTokenTypes.oCOLON) {
            firstColon = firstColon.getNextSibling();
View Full Code Here

Examples of ro.redeul.google.go.lang.psi.expressions.GoExpr

    private String getExpression(GoIfStatement outer, GoIfStatement inner) {
        return getExpressionDeclaration(outer) + " && " + getExpressionDeclaration(inner);
    }

    private String getExpressionDeclaration(GoIfStatement ifStatement) {
        GoExpr expr = ifStatement.getExpression();
        return isOrExpression(expr) ? "(" + expr.getText() + ")" : expr.getText();
    }
View Full Code Here

Examples of ro.redeul.google.go.lang.psi.expressions.GoExpr

            }
        }.visitFile(file);
    }

    private boolean preValidate(GoBinaryExpression expression) {
        GoExpr left = expression.getLeftOperand();
        GoExpr right = expression.getRightOperand();

        if (left == null || right == null)
            return false;

        if (left.isConstantExpression() || right.isConstantExpression())
            return false;

        GoType[] leftTypes = left.getType();
        GoType[] rightTypes = right.getType();
        if (leftTypes.length == 0 || rightTypes.length == 0 || leftTypes[0] == null || rightTypes[0] == null)
            return false;

        return true;
    }
View Full Code Here

Examples of ro.redeul.google.go.lang.psi.expressions.GoExpr

            case NotEq:
        }
    }

    public static void checkBinaryExpression(InspectionResult result, GoBinaryExpression expression) {
        GoExpr left = expression.getLeftOperand();
        GoExpr right = expression.getRightOperand();
        if (left == null || right == null) {
            return;
        }
        if (left.isConstantExpression() || right.isConstantExpression()){
            return;
        }
        GoType[] leftTypes = left.getType();
        GoType[] rightTypes = right.getType();
        if (leftTypes.length == 0 || rightTypes.length == 0){
            return;
        }

        String operator = expression.op().toString();
View Full Code Here

Examples of ro.redeul.google.go.lang.psi.expressions.GoExpr

            else {
                GoLiteralIdentifier definition = GoPsiUtils.resolveSafely(identifier, GoLiteralIdentifier.class);
                if (definition != null) {
                    GoConstDeclaration constDeclaration = getAs(GoConstDeclaration.class, definition.getParent());

                    GoExpr valueExpression = constDeclaration.getExpression(definition);
                    if (valueExpression != null)
                        valueExpression.accept(this);
                }
            }
        }
View Full Code Here

Examples of ro.redeul.google.go.lang.psi.expressions.GoExpr

            }
        }

        @Override
        public void visitParenthesisedExpression(GoParenthesisedExpression expression) {
            GoExpr inner = expression.getInnerExpression();
            if (inner != null)
                inner.accept(this);
        }
View Full Code Here

Examples of ro.redeul.google.go.lang.psi.expressions.GoExpr

                inner.accept(this);
        }

        @Override
        public void visitUnaryExpression(GoUnaryExpression expression) {
            GoExpr inner = expression.getExpression();
            if (inner == null)
                return;

            inner.accept(this);
            if (getData() == null)
                return;

            GoUnaryExpression.Op op = expression.getUnaryOp();
View Full Code Here

Examples of ro.redeul.google.go.lang.psi.expressions.GoExpr

            }
        }

        @Override
        public void visitBinaryExpression(GoBinaryExpression expression) {
            GoExpr lExpr = expression.getLeftOperand();
            GoExpr rExpr = expression.getRightOperand();

            if (lExpr == null || rExpr == null)
                return;

            lExpr.accept(this);
            if (getData() == null)
                return;

            Pair<GoLiteral.Type, ? extends Number> lValue = getData();
            rExpr.accept(this);
            if (getData() == null)
                return;

            Pair<GoLiteral.Type, ? extends Number> rValue = getData();
View Full Code Here

Examples of ro.redeul.google.go.lang.psi.expressions.GoExpr

    }

    public abstract GoExpr getRangeExpression();

    public GoType[] getKeyType() {
        GoExpr rangeExpression = getRangeExpression();
        if (rangeExpression == null) {
            return GoType.EMPTY_ARRAY;
        }
        GoType goType;
        GoType[] rangeType = rangeExpression.getType();
        if (rangeType.length == 0) {
            return GoType.EMPTY_ARRAY;
        }

        goType = rangeType[0].underlyingType();
View Full Code Here

Examples of ro.redeul.google.go.lang.psi.expressions.GoExpr

            public GoType[] visitChannel(GoTypeChannel type) { return new GoType[]{type.getElementType()}; }
        }.visit(goType);
    }

    public GoType[] getValueType() {
        GoExpr rangeExpression = getRangeExpression();
        if (rangeExpression == null) {
            return GoType.EMPTY_ARRAY;
        }
        GoType goType;
        GoType[] rangeType = rangeExpression.getType();
        if (rangeType.length == 0) {
            return GoType.EMPTY_ARRAY;
        }
        goType = rangeType[0].underlyingType();
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.