Examples of FunctionDef


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

        if (node instanceof ClassDef) {
            node = getClassDefInit((ClassDef) node);
        }

        if (node instanceof FunctionDef) {
            FunctionDef f = (FunctionDef) node;

            String startPar = "( ";
            FastStringBuffer buffer = new FastStringBuffer(startPar, 40);

            for (int i = 0; i < f.args.args.length; i++) {
View Full Code Here

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

        if (ast != null) {
            if (ast instanceof ClassDef) {
                ast = NodeUtils.getClassDefInit((ClassDef) ast);
            }
            if (ast instanceof FunctionDef) {
                FunctionDef functionDef = (FunctionDef) ast;
                if (functionDef.args != null) {
                    String printed = PrettyPrinterV2.printArguments(new IGrammarVersionProvider() {

                        public int getGrammarVersion() throws MisconfigurationException {
                            return IGrammarVersionProvider.GRAMMAR_PYTHON_VERSION_3_0;
View Full Code Here

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

    }

    public static SimpleNode getClassDefInit(ClassDef classDef) {
        for (stmtType t : classDef.body) {
            if (t instanceof FunctionDef) {
                FunctionDef def = (FunctionDef) t;
                if (((NameTok) def.name).id.equals("__init__")) {
                    return def;
                }
            }
        }
View Full Code Here

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

            ClassDef def = (ClassDef) node;
            return ((NameTok) def.name).id;
        }

        if (node instanceof FunctionDef) {
            FunctionDef def = (FunctionDef) node;
            return ((NameTok) def.name).id;
        }

        if (node instanceof Call) {
            Call call = ((Call) node);
View Full Code Here

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

    public static Str getNodeDocStringNode(SimpleNode node) {
        Str s = null;
        stmtType body[] = null;
        if (node instanceof FunctionDef) {
            FunctionDef def = (FunctionDef) node;
            body = def.body;
        } else if (node instanceof ClassDef) {
            ClassDef def = (ClassDef) node;
            body = def.body;
View Full Code Here

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

        if (ast2 instanceof ClassDef) {
            ClassDef c = (ClassDef) ast2;
            return c.name;
        }
        if (ast2 instanceof FunctionDef) {
            FunctionDef c = (FunctionDef) ast2;
            return c.name;
        }
        return ast2;

    }
View Full Code Here

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

        if (ast2 instanceof ClassDef) {
            ClassDef def = (ClassDef) ast2;
            return def.name.beginColumn;
        }
        if (ast2 instanceof FunctionDef) {
            FunctionDef def = (FunctionDef) ast2;
            return def.name.beginColumn;
        }
        return ast2.beginColumn;
    }
View Full Code Here

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

            ClassDef module = (ClassDef) node;
            return module.body;
        }

        if (node instanceof FunctionDef) {
            FunctionDef module = (FunctionDef) node;
            return module.body;
        }

        if (node instanceof excepthandlerType) {
            excepthandlerType module = (excepthandlerType) node;
View Full Code Here

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

        } else if (entry.node instanceof ClassDef) {
            ClassDef def = (ClassDef) entry.node;
            foldingEntry = new FoldingEntry(FoldingEntry.TYPE_DEF, def.name.beginLine - 1, entry.endLine, entry);

        } else if (entry.node instanceof FunctionDef) {
            FunctionDef def = (FunctionDef) entry.node;
            foldingEntry = new FoldingEntry(FoldingEntry.TYPE_DEF, def.name.beginLine - 1, entry.endLine, entry);

        } else if (entry.node instanceof TryExcept) {
            foldingEntry = new FoldingEntry(FoldingEntry.TYPE_EXCEPT, entry.node.beginLine - 1, entry.endLine, entry);
View Full Code Here

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

    private void startMethod(String name, int startMethodRow, int startMethodCol) {
        if (startMethodCol == 1) {
            endScopesInStack();
        }
        NameTok nameTok = new NameTok(name, NameTok.ClassName);
        FunctionDef functionDef = new FunctionDef(nameTok, null, null, null, null);
        functionDef.beginLine = startMethodRow;
        functionDef.beginColumn = startMethodCol;

        addToPertinentScope(functionDef);
        if (stack.size() == 0) {
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.