Home

Awesome

Welcome to the GN parser and code model/browser

This is a parser, code model and browser for the GN meta-build system written in C++ and Qt. See https://gn.googlesource.com/gn for more information about GN. The syntax was retrieved using the command gn help grammar and modified for Coco/R compatibility using https://github.com/rochus-keller/EbnfStudio.

The goal of this project is to build tools to better understand the GN meta-build system used by the Google Dart SDK. My real goal is to understand the Dart Runtime and to be able to integrate Dart as an embedded language into a system I am currently planning. Dart, like the Chromium and V8 projects, uses the GN meta-build system. This build system is very powerful, but also very complex. GN has useful documentation and commands for analyzing a project. But with a build system as big as the one of the Dart SDK, I still lose sight when only using command line tools (there were moments when I began to wonder if "GN" was meant as an abbreviation for "go nuts"). That was the primary reason why I implemented a parser/code model integrated with a navigable GUI based code browser myself. I hope it will be useful for others as well.

Parser and code model features

Code browser features

GnViewer Screenshot

Binary version

Here is a binary version of GnViewer for Linux x86: http://software.rochus-keller.ch/GnViewer_linux_x86.tar.gz Just download, unpack and run it; no installer is needed. The Qt core libraries have to be separately installed. The binary was built using Qt 5.4.

Build Steps

Follow these steps if you want to build GnViewer yourself:

  1. Make sure a Qt 5.x (libraries and headers) version compatible with your C++ compiler is installed on your system.
  2. Download the source code from https://github.com/rochus-keller/GnTools/archive/master.zip and unpack it.
  3. Goto the unpacked directory and execute QTDIR/bin/qmake GnViewer.pro (see the Qt documentation concerning QTDIR).
  4. Run make; after a couple of seconds you will find the executable in the build directory.

Alternatively you can open GnViewer.pro using QtCreator and build it there.

The library makes use of a parser generated by Coco/R based on input from EbnfStudio. There are no other dependencies than the Qt Core, GUI and Widgets modules from the Qt Base package. The repository already contains the generated files. In order to regenerate GnParser.cpp/h you have to use this version of Coco/R: https://github.com/rochus-keller/Coco .

To do's

Support

If you need support or would like to post issues or feature requests please use the Github issue list at https://github.com/rochus-keller/GnTools/issues or send an email to the author.