Home

Awesome

PyCscope

Purpose

A python script to generate a cscope index from a Python source tree. pycscope uses Python's own parser and (C)oncrete (S)yntax (T)ree to generate the index, so it is a bit more accurate than plain cscope.

Usage

    pycscope.py [-D] [-R] [-S] [-V] [-f reffile] [-e path1[,path2,...]] [-i srclistfile] [files ...]

    -D                Dump the (C)oncrete (S)yntax (T)ree generated by the parser for each file
    -R                Recurse directories for files
    -S                Interpret simple strings as symbols
    -V                Print version and exit
    -f reffile        Use 'reffile' as cross-ref file name instead of 'cscope.out'
    -i srclistfile    Use the contents of 'srclistfile' as the list of source files to scan
    -e path1,path2..  Exclude the list of paths from being parse

Example

Rough example using vim as your cscope client:

    pycscope -R .
    # now you have a cscope.out. use it like you would cscope
    vim hello.py
    :cscope add cscope.out
    :cscope find s sys

Install

PyCscope uses Python's distutils package for installation. Use the following command to install this package:

    % python setup.py install

Features

PyCscope has the following features:

A mark is an indicator to the cscope utility that something of interest follows.

History

Status

It works well enough to generate an index file that can be used by the CscopeFinder plugin for jEdit, emacs cscope support, or vim's cscope handling. Other editors are not tested.