Package com.python.pydev.analysis.visitors

Examples of com.python.pydev.analysis.visitors.OccurrencesVisitor


public class OccurrencesAnalyzer {

    public IMessage[] analyzeDocument(IPythonNature nature, SourceModule module, IAnalysisPreferences prefs,
            IDocument document, IProgressMonitor monitor, IIndentPrefs indentPrefs) {

        OccurrencesVisitor visitor = new OccurrencesVisitor(nature, module.getName(), module, prefs, document, monitor);
        try {
            SimpleNode ast = module.getAst();
            if (ast != null) {
                if (nature.startRequests()) {
                    try {
                        ast.accept(visitor);
                    } finally {
                        nature.endRequests();
                    }
                }
            }
        } catch (OperationCanceledException e) {
            throw e;
        } catch (Exception e) {
            Log.log(IStatus.ERROR, ("Error while visiting " + module.getName() + " (" + module.getFile() + ")"), e);
        }

        List<IMessage> messages = new ArrayList<IMessage>();
        if (!monitor.isCanceled()) {
            messages = visitor.getMessages();
            try {
                messages.addAll(TabNanny.analyzeDoc(document, prefs, module.getName(), indentPrefs, monitor));
            } catch (Exception e) {
                Log.log(e); //just to be safe... (could happen if the document changes during the process).
            }
View Full Code Here

TOP

Related Classes of com.python.pydev.analysis.visitors.OccurrencesVisitor

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.