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

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


            case JJTEXEC_STMT:
                ret = new Exec(null, null, null);
                break;

            case JJTPASS_STMT:
                ret = new Pass();
                break;

            case JJTBREAK_STMT:
                ret = new Break();
                break;
View Full Code Here


                    } else {
                        try {
                            stmts[i] = (stmtType) yield_or_stmt;
                        } catch (ClassCastException e) {
                            recoverFromClassCastException(yield_or_stmt, e);
                            stmts[i] = new Pass(); //recover from it with a valid node!
                        }
                    }
                }
                return new Suite(stmts);
View Full Code Here

        PyAstFactory factory = new PyAstFactory(new AdapterPrefs(delimiter, versionProvider));
        stmtType overrideBody = factory.createOverrideBody(this.functionDef, parentClassName, currentClassName); //Note that the copy won't have a parent.

        FunctionDef functionDef = this.functionDef.createCopy(false);
        functionDef.body = new stmtType[] { overrideBody != null ? overrideBody : new Pass() };

        try {
            MakeAstValidForPrettyPrintingVisitor.makeValid(functionDef);
        } catch (Exception e) {
            Log.log(e);
View Full Code Here

                    String msg = "Error. Found yield out of scope.";
                    final ParseException e2 = new ParseException(msg, node);
                    this.stack.getGrammar().addAndReport(e2, msg);
                } else {
                    recoverFromClassCastException(node, e);
                    stmts[i] = new Pass(); //recover from it with a valid node!
                }
            }
        }
        return stmts;
    }
View Full Code Here

        fixNode(node);
        node.test.accept(this);

        if (node.body == null || node.body.length == 0) {
            node.body = new stmtType[] { new Pass() };
        }

        for (SimpleNode n : node.body) {
            n.accept(this);
        }
View Full Code Here

        //in b
        node.iter.accept(this);

        if (node.body == null || node.body.length == 0) {
            node.body = new stmtType[] { new Pass() };
        }

        for (SimpleNode n : node.body) {
            n.accept(this);
        }
View Full Code Here

    }

    @Override
    public Object visitTryFinally(TryFinally node) throws Exception {
        if (node.body == null || node.body.length == 0) {
            node.body = new stmtType[] { new Pass() };
        }

        visitTryPart(node, node.body);
        visitOrElsePart(node.finalbody, "finally");
        return null;
View Full Code Here

    }

    @Override
    public Object visitTryExcept(TryExcept node) throws Exception {
        if (node.body == null || node.body.length == 0) {
            node.body = new stmtType[] { new Pass() };
        }

        visitTryPart(node, node.body);
        for (excepthandlerType h : node.handlers) {

            fixNode(h);

            if (h.type != null) {
                h.type.accept(this);
            }
            if (h.name != null) {
                h.name.accept(this);
            }

            if (h.body == null || h.body.length == 0) {
                h.body = new stmtType[] { new Pass() };
            }

            for (stmtType st : h.body) {
                st.accept(this);
            }
View Full Code Here

        node.name.accept(this);

        handleArguments(node.bases, node.keywords, node.starargs, node.kwargs);

        if (node.body == null || node.body.length == 0) {
            node.body = new stmtType[] { new Pass() };
        }

        for (SimpleNode n : node.body) {
            n.accept(this);
        }
View Full Code Here

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

        if (node.body == null || node.body.length == 0) {
            node.body = new stmtType[] { new Pass() };
        }

        int length = node.body.length;
        for (int i = 0; i < length; i++) {
            if (node.body[i] != null) {
View Full Code Here

TOP

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

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.