Package com.redhat.ceylon.compiler.typechecker.tree.Tree

Examples of com.redhat.ceylon.compiler.typechecker.tree.Tree.PositionalArgument


        // same test as in ExpressionTransformer.checkForByteLiterals
        if(ce.getPrimary() instanceof Tree.BaseTypeExpression
                && ce.getPositionalArgumentList() != null){
            java.util.List<Tree.PositionalArgument> positionalArguments = ce.getPositionalArgumentList().getPositionalArguments();
            if(positionalArguments.size() == 1){
                PositionalArgument argument = positionalArguments.get(0);
                if(argument instanceof Tree.ListedArgument
                        && ((Tree.ListedArgument) argument).getExpression() != null){
                    Term term = ((Tree.ListedArgument)argument).getExpression().getTerm();
                    if(term instanceof Tree.NegativeOp){
                        term = ((Tree.NegativeOp) term).getTerm();
View Full Code Here


        // same test as in BoxingVisitor.isByteLiteral()
        if(ce.getPrimary() instanceof Tree.BaseTypeExpression
                && ce.getPositionalArgumentList() != null){
            java.util.List<Tree.PositionalArgument> positionalArguments = ce.getPositionalArgumentList().getPositionalArguments();
            if(positionalArguments.size() == 1){
                PositionalArgument argument = positionalArguments.get(0);
                if(argument instanceof Tree.ListedArgument
                        && ((Tree.ListedArgument) argument).getExpression() != null){
                    Term term = ((Tree.ListedArgument)argument).getExpression().getTerm();
                    boolean negative = false;
                    if(term instanceof Tree.NegativeOp){
View Full Code Here

            } else if (primary instanceof Tree.BaseTypeExpression) {
                Tree.BaseTypeExpression bte = (Tree.BaseTypeExpression)primary;
                if (exprGen.typeFact().getByteDeclaration().equals(bte.getDeclaration())) {
                    // Special case for "Byte(x)" where we make use of the fact that it looks
                    // like an annotation class instantiation but is in fact a byte literal
                    PositionalArgument arg = invocation.getPositionalArgumentList().getPositionalArguments().get(0);
                    arg.visit(this);
                } else {
                    if (!Decl.isAnnotationClass(bte.getDeclaration())) {
                        append(exprGen.makeErroneous(primary, "compiler bug: " + bte.getDeclaration().getName() + " is not an annotation class"));
                    }
                    append(transformInstantiation(exprGen, invocation));
View Full Code Here

    Tree.PositionalArgumentList getPositional() {
        return positional;
    }
    @Override
    protected Tree.Expression getArgumentExpression(int argIndex) {
        PositionalArgument arg = getPositional().getPositionalArguments().get(argIndex);
        if(arg instanceof Tree.ListedArgument)
            return ((Tree.ListedArgument) arg).getExpression();
        if(arg instanceof Tree.SpreadArgument)
            return ((Tree.SpreadArgument) arg).getExpression();
        throw new BugException("argument expression is " + arg.getNodeType());
    }
View Full Code Here

        throw new BugException("argument expression is " + arg.getNodeType());
    }
   
    @Override
    protected boolean isArgumentComprehension(int argIndex){
        PositionalArgument arg = getPositional().getPositionalArguments().get(argIndex);
        return arg instanceof Tree.Comprehension;
    }
View Full Code Here

        return arg instanceof Tree.Comprehension;
    }
   
    @Override
    protected ProducedType getArgumentType(int argIndex) {
        PositionalArgument arg = getPositional().getPositionalArguments().get(argIndex);
        if (arg instanceof Tree.Comprehension) {
            return gen.typeFact().getSequentialType(arg.getTypeModel());
        }
        return arg.getTypeModel();
    }
View Full Code Here

        }
        return arg.getTypeModel();
    }
    @Override
    protected JCExpression getTransformedArgumentExpression(int argIndex) {
        PositionalArgument arg = getPositional().getPositionalArguments().get(argIndex);
        // FIXME: I don't like much this weird special case here
        if(arg instanceof Tree.ListedArgument){
            Tree.Expression expr = ((Tree.ListedArgument) arg).getExpression();
            if (expr.getTerm() instanceof FunctionArgument) {
                FunctionArgument farg = (FunctionArgument)expr.getTerm();
View Full Code Here

    @Override
    protected boolean isSpread() {
        java.util.List<PositionalArgument> args = getPositional().getPositionalArguments();
        if(args.isEmpty())
            return false;
        PositionalArgument last = args.get(args.size()-1);
        return last instanceof Tree.SpreadArgument || last instanceof Tree.Comprehension;
    }
View Full Code Here

        return last instanceof Tree.SpreadArgument || last instanceof Tree.Comprehension;
    }
   
    @Override
    protected boolean isArgumentSpread(int argIndex) {
        PositionalArgument arg = getPositional().getPositionalArguments().get(argIndex);
        return arg instanceof Tree.SpreadArgument || arg instanceof Tree.Comprehension;
    }
View Full Code Here

TOP

Related Classes of com.redhat.ceylon.compiler.typechecker.tree.Tree.PositionalArgument

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.