Examples of AliasType


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

    }

    public Tuple<IModule, String> findModule(String moduleToFind, String currentModule, ICompletionState state,
            IModule current) throws CompletionRecursionException, MisconfigurationException {
        NameTok name = new NameTok(moduleToFind, NameTok.ImportModule);
        Import impTok = new Import(new aliasType[] { new aliasType(name, null) });

        List<IToken> tokens = new ArrayList<IToken>();
        List<IToken> imp = AbstractVisitor.makeImportToken(impTok, tokens, currentModule, true);
        IToken importedModule = imp.get(imp.size() - 1); //get the last one (it's the one with the 'longest' representation).
        return this.findOnImportedMods(importedModule, "", state, "", currentModule, current);
View Full Code Here

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

            Name name = (Name) node;
            return name.id;
        }

        if (node instanceof aliasType) {
            aliasType type = (aliasType) node;
            return ((NameTok) type.name).id;
        }
        if (node instanceof Attribute) {
            Attribute attribute = (Attribute) node;
            return discoverRep(attribute.attr);
View Full Code Here

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

        for (int i = 0; i < node.names.length; i++) {
            if (i > 0) {

            }
            aliasType alias = node.names[i];
            handleAlias(alias);

        }

        fixAfterNode(node);
View Full Code Here

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

        if (node.module != null) {
            node.module.accept(this);
        }

        for (int i = 0; i < node.names.length; i++) {
            aliasType alias = node.names[i];
            handleAlias(alias);
        }
        fixAfterNode(node);

        return null;
View Full Code Here

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

        } else if (astThis.node instanceof Import) {
            aliasType[] imports = ((Import) astThis.node).names;
            FastStringBuffer retVal = new FastStringBuffer();
            for (int i = 0; i < imports.length; i++) {
                aliasType aliasType = imports[i];

                //as ...
                if (aliasType.asname != null) {
                    retVal.append(((NameTok) aliasType.asname).id);
                    retVal.append(" = ");
                }

                retVal.append(((NameTok) aliasType.name).id);
                retVal.append(", ");
            }
            //delete the last 2 chars
            retVal.deleteLast();
            retVal.deleteLast();
            return retVal.toString();

        } else if (astThis.node instanceof ImportFrom) {
            // from wxPython.wx import *
            ImportFrom importToken = (ImportFrom) astThis.node;
            StringBuffer modules = new StringBuffer();
            for (int i = 0; i < importToken.names.length; i++) {
                aliasType aliasType = importToken.names[i];

                //as ...
                if (aliasType.asname != null) {
                    modules.append(((NameTok) aliasType.asname).id);
                    modules.append(" = ");
View Full Code Here

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

            } else if (node instanceof Import) {
                ArrayList<SimpleNode> ret = new ArrayList<SimpleNode>();
                Import importToken = (Import) node;
                for (int i = 0; i < importToken.names.length; i++) {
                    aliasType aliasType = importToken.names[i];

                    //as ...
                    if (aliasType.asname != null) {
                        ret.add(aliasType.asname);
                    }

                    ret.add(aliasType.name);
                }
                return ret.toArray(new SimpleNode[0]);

            } else if (node instanceof ImportFrom) {
                ArrayList<SimpleNode> ret = new ArrayList<SimpleNode>();
                ImportFrom importToken = (ImportFrom) node;
                boolean found = false;
                for (int i = 0; i < importToken.names.length; i++) {
                    found = true;
                    aliasType aliasType = importToken.names[i];

                    //as ...
                    if (aliasType.asname != null) {
                        ret.add(aliasType.asname);
                    }
View Full Code Here

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

        if (initialImportName.length() > 0) {
            initialImportName = initialImportName + ".";
        }

        for (int i = 0; i < names.length; i++) {
            aliasType aliasType = names[i];

            String name = null;
            String original = ((NameTok) aliasType.name).id;

            if (aliasType.asname != null) {
View Full Code Here

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

                NameTok importNameTok = new NameTok(m, NameTok.ImportModule);

                importNameTok.beginLine = tokModName.beginLine;
                importNameTok.beginColumn = tokModName.beginColumn;

                names[0] = new aliasType(importNameTok, null);
                names[0].beginLine = tokModName.beginLine;
                names[0].beginColumn = tokModName.beginColumn;

                Import importTok = new Import(names);
                importTok.beginLine = tokModName.beginLine;
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.