Package org.python.pydev.parser.jython.ast

Examples of org.python.pydev.parser.jython.ast.Name


            ICompletionState state;
            if (ast instanceof ClassDef) {
                ClassDef c = (ClassDef) ast;
                for (int j = 0; j < c.bases.length; j++) {
                    if (c.bases[j] instanceof Name) {
                        Name n = (Name) c.bases[j];
                        String base = n.id;
                        //An error in the programming might result in an error.
                        //
                        //e.g. The case below results in a loop.
                        //
View Full Code Here


            throws CompletionRecursionException {
        throw new RuntimeException("Not implemented");
    }

    public IToken[] getCompletionsForModule(IModule module, ICompletionState state) throws CompletionRecursionException {
        return new IToken[] { new SourceToken(new Name("True", Name.Store, true), "True", "", "", "__builtin__"),
                new SourceToken(new Name("False", Name.Store, true), "False", "", "", "__builtin__"), };
    }
View Full Code Here

                ClassDef d = (ClassDef) node;

                if (getOnlySupers) {
                    for (int i = 0; i < d.bases.length; i++) {
                        if (d.bases[i] instanceof Name) {
                            Name n = (Name) d.bases[i];
                            state.setActivationToken(n.id);
                            IToken[] completions;
                            try {
                                ICodeCompletionASTManager astManager = request.nature.getAstManager();
                                IModule module = request.getModule();
View Full Code Here

    }

    private exprType extractKwargs(argumentsType argType) {
        NameTok kwarg = (NameTok) argType.kwarg;
        if (kwarg != null) {
            return new Name(kwarg.id, Name.Load, false);
        } else {
            return null;
        }
    }
View Full Code Here

    }

    private exprType extractStarargs(argumentsType argType) {
        NameTok vararg = (NameTok) argType.vararg;
        if (vararg != null) {
            return new Name(vararg.id, Name.Load, false);
        } else {
            return null;
        }
    }
View Full Code Here

        }
        return ret;
    }

    private Attribute createAttribute() {
        return new Attribute(new Name(baseClassName, Name.Load, false), new NameTok(method.getName(), NameTok.Attrib),
                Attribute.Load);
    }
View Full Code Here

                if (isInClassMethodDecl()) {
                    Attribute a = (Attribute) t;
                    if (a.value instanceof Name) {

                        //it is an instance variable attribute
                        Name n = (Name) a.value;
                        if (n.id.equals("self")) {
                            atomic(t);
                        }
                    }
                }
View Full Code Here

            if (visitor.isInClassMethodDecl()) {
                Attribute a = (Attribute) t;
                if (a.value instanceof Name) {

                    //it is an instance variable attribute
                    Name n = (Name) a.value;
                    if (n.id.equals("self")) {
                        visitor.atomic(t);
                    }
                }
View Full Code Here

            NameTok tok = (NameTok) node;
            return tok.id;
        }

        if (node instanceof Name) {
            Name name = (Name) node;
            return name.id;
        }

        if (node instanceof aliasType) {
            aliasType type = (aliasType) node;
View Full Code Here

            }
        }

        String lastPart = dotSplit.get(0);
        if (lastPart.endsWith("()")) {
            last.value = new Call(new Name(lastPart.substring(0, lastPart.length() - 2), Name.Load, false), null, null,
                    null, null);
        } else {
            last.value = new Name(lastPart, Name.Load, false);
        }
        return first;
    }
View Full Code Here

TOP

Related Classes of org.python.pydev.parser.jython.ast.Name

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.