Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
GCC plugin to generate ETags-like TAGS files
C++ Shell
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.gitignore
Makefile
README.org
g++etags.sh
gccetags.c++
gccetags.sh
makeetags.sh
test.c++
test.h++

README.org

gcc-etags README

gcc-etags is a GCC plugin to create etags compatible files for C++. Tags are a (rather primitive) way of navigating source code in Emacs or other editors. ETag is the implementation that comes with Emacs and the tags basically consist of a short regex, the name of the tag and where to find it. While ETag has a very primitive mechanism of parsing files gcc-etags uses the GCC plugin interface to utilize GCC’s C++ frontend.

This is more of an experimental package I wrote to understand the GCC plugin interface. It is very hacky and currently does not even support struct/class members. Much of the code is inspired by Boris Kolpackov’s blog series about GCC plugins: Parsing C++ with GCC plugins, Part 1, Part 2, and Part 3. Also checkout the GCC wiki on Plugins and the GCC documentation.

Building/Install

gcc-etags requires a new version of GCC (4.5+). On Ubuntu/Debian the gcc-*-plugin-dev package is required (e.g., gcc-4.6-plugin-dev for GCC 4.6). To build it simply call make.

Usage

To use gcc-etags simply call g++ with the following parameters: -S -fplugin\./gccetags.so=. To make things easier there is a g++etags.sh wrapper script available. Theoretically gcc-etags can utilize a projects Makefile and change the gcc/g++ calls to the appropriated gcc-etags calls. There is a script makeetags.sh available to achieve this.

Something went wrong with that request. Please try again.