Package org.python.pydev.parser.jython

Examples of org.python.pydev.parser.jython.SimpleNode.accept()


                "\n" +
                "";
        Tuple<SimpleNode, Throwable> objects = PyParser.reparseDocument(new PyParser.ParserInfo(new Document(str),
                IPythonNature.GRAMMAR_PYTHON_VERSION_2_4));
        SimpleNode root = objects.o1;
        root.accept(visitor);
        Iterator<ASTEntry> iterator = visitor.getIterator();
        check((ASTEntryWithChildren) iterator.next(), "While", 1, 1, 4, 0);
        assertTrue(iterator.hasNext() == false);

    }
View Full Code Here


                "\n" +
                "";
        Tuple<SimpleNode, Throwable> objects = PyParser.reparseDocument(new PyParser.ParserInfo(new Document(str),
                IPythonNature.GRAMMAR_PYTHON_VERSION_2_4));
        SimpleNode root = objects.o1;
        root.accept(visitor);
        Iterator<ASTEntry> iterator = visitor.getIterator();
        check((ASTEntryWithChildren) iterator.next(), "TryExcept", 1, 1, 4, 0);
        assertTrue(iterator.hasNext() == false);

    }
View Full Code Here

                "\n" +
                "";
        Tuple<SimpleNode, Throwable> objects = PyParser.reparseDocument(new PyParser.ParserInfo(new Document(str),
                IPythonNature.GRAMMAR_PYTHON_VERSION_2_4));
        SimpleNode root = objects.o1;
        root.accept(visitor);
        Iterator<ASTEntry> iterator = visitor.getIterator();
        check((ASTEntryWithChildren) iterator.next(), "TryFinally", 1, 1, 4, 0);
        assertTrue(iterator.hasNext() == false);
    }
View Full Code Here

                "\n" +
                "";
        Tuple<SimpleNode, Throwable> objects = PyParser.reparseDocument(new PyParser.ParserInfo(new Document(str),
                IPythonNature.GRAMMAR_PYTHON_VERSION_2_5));
        SimpleNode root = objects.o1;
        root.accept(visitor);
        Iterator<ASTEntry> iterator = visitor.getIterator();
        check((ASTEntryWithChildren) iterator.next(), "TryFinally", 1, 1, 4, 0);
        assertTrue(iterator.hasNext() == false);
    }
View Full Code Here

                "'''\n" +
                "";
        Tuple<SimpleNode, Throwable> objects = PyParser.reparseDocument(new PyParser.ParserInfo(new Document(str),
                IPythonNature.GRAMMAR_PYTHON_VERSION_2_5));
        SimpleNode root = objects.o1;
        root.accept(visitor);
        Iterator<ASTEntry> iterator = visitor.getIterator();
        check((ASTEntryWithChildren) iterator.next(), "Str", 1, 1, 3, 0);
        assertTrue(iterator.hasNext() == false);
    }
View Full Code Here

                "        pass\n" +
                "\n";
        Tuple<SimpleNode, Throwable> objects = PyParser.reparseDocument(new PyParser.ParserInfo(new Document(str),
                IPythonNature.GRAMMAR_PYTHON_VERSION_2_5));
        SimpleNode root = objects.o1;
        root.accept(visitor);
        Iterator<ASTEntry> iterator = visitor.getIterator();
        ASTEntry method = iterator.next();
        check((ASTEntryWithChildren) method, "foo", 1, 1, 12, 2);
        List<ASTEntryWithChildren> children = ((ASTEntryWithChildren) method).children;
        ASTEntryWithChildren try1 = children.get(0);
View Full Code Here

            ScopeAnalyzerVisitorForImports visitor = new ScopeAnalyzerVisitorForImports(request.nature,
                    module.getName(), module, new NullProgressMonitor(), request.ps.getCurrToken().o1,
                    request.ps.getActivationTokenAndQual(true), moduleToFind);

            SimpleNode root = module.getAst();
            root.accept(visitor);
            entryOccurrences = visitor.getEntryOccurrences();
            if (entryOccurrences.size() > 0) {
                //only add comments and strings if there's at least some other occurrence
                entryOccurrences.addAll(ScopeAnalysis.getCommentOccurrences(request.initialName, root));
                entryOccurrences.addAll(ScopeAnalysis.getStringOccurrences(request.initialName, root));
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.